-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
I'm submitting a...
- Feature request (UserVoice request: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/33684469-add-switchpresenter-control)
Problem
When providing a choice to the user, like picking a check-in method:

It could be handy to be able to swap out controls with XAML vs having to create separate complex visual states or logic to handle the dynamic UI changes.
Solution
The SwitchPresenter control would act as a switch statement for XAML providing a dynamic way to change out content based on some other value.
<ComboBox x:Name="Lookup" Header="Look up reservation" SelectedIndex="0">
<x:String>Select an option</x:String>
<x:String>Confirmation Code</x:String>
<x:String>E-ticket number</x:String>
<x:String>Mileage Plan number</x:String>
</ComboBox>
<controls:SwitchPresenter Value="{x:Bind Lookup.SelectedItem}">
<controls:Case Value="Confirmation Code">
<TextBox Name="ConfirmationCodeValidator"
extensions:TextBoxRegex.Regex="^[a-zA-Z]{6}$"
Header="Confirmation code"
PlaceholderText="6 letters" />
</controls:Case>
<controls:Case Value="E-ticket number">
<TextBox Name="TicketValidator"
extensions:TextBoxRegex.Regex="(^\d{10}$)|(^\d{13}$)"
Header="E-ticket number"
PlaceholderText="10 or 13 numbers" />
</controls:Case>
<controls:Case Value="Millage Plan number">
<TextBox Name="PlanValidator"
Header="Mileage Plan #"
PlaceholderText="Mileage Plan #" />
</controls:Case>
<controls:Case IsDefault="True">
</controls:Case>
</controls:SwitchPresenter>yoshiask, Mrxx99, robloo, Arlodotexe, agneszitte and 1 more

