|
19 | 19 | </ComboBox> |
20 | 20 | <!-- SwitchPresenter binds to a value --> |
21 | 21 | <controls:SwitchPresenter Value="{Binding SelectedItem, ElementName=Lookup}"> |
22 | | - <!-- And then only dynamically displays the Case with matching Value --> |
| 22 | + <!-- And then only dynamically displays the Case with the matching Value --> |
23 | 23 | <controls:Case Value="Confirmation Code"> |
24 | 24 | <StackPanel> |
25 | 25 | <TextBox Name="ConfirmationCodeValidator" |
|
43 | 43 | Header="Mileage Plan #" |
44 | 44 | PlaceholderText="Mileage Plan #" /> |
45 | 45 | </controls:Case> |
| 46 | + <!-- You can also provide a default case if no match is found --> |
46 | 47 | <controls:Case IsDefault="True"> |
47 | 48 | <TextBlock>Please select a way to lookup your reservation above...</TextBlock> |
48 | 49 | </controls:Case> |
49 | 50 | </controls:SwitchPresenter> |
50 | | - |
51 | | - <!-- Advanced scenario using Type information --> |
| 51 | + |
| 52 | + <Border Height="2" Background="Gray" Margin="0,16"/> |
| 53 | + |
| 54 | + <!-- Scenario using an Enum --> |
52 | 55 | <ComboBox x:Name="AnimalPicker" |
53 | 56 | Header="Pick an Animal" |
54 | 57 | ItemsSource="{ui:EnumValues Type=enums:Animal}" |
55 | 58 | SelectedIndex="0"/> |
56 | 59 | <controls:SwitchPresenter Value="{Binding SelectedItem, ElementName=AnimalPicker}" |
57 | | - TargetType="enums:Animal"> |
| 60 | + TargetType="enums:Animal" |
| 61 | + Padding="16"> |
58 | 62 | <controls:Case Value="Cat"> |
59 | | - <TextBlock>🐈</TextBlock> |
| 63 | + <TextBlock FontSize="32">🐈</TextBlock> |
60 | 64 | </controls:Case> |
61 | 65 | <controls:Case Value="Dog"> |
62 | | - <TextBlock>🐕</TextBlock> |
| 66 | + <TextBlock FontSize="32">🐕</TextBlock> |
63 | 67 | </controls:Case> |
64 | 68 | <controls:Case Value="Bunny"> |
65 | | - <TextBlock>🐇</TextBlock> |
| 69 | + <TextBlock FontSize="32">🐇</TextBlock> |
| 70 | + </controls:Case> |
| 71 | + <controls:Case Value="Parrot"> |
| 72 | + <TextBlock FontSize="32">🦜</TextBlock> |
| 73 | + </controls:Case> |
| 74 | + <controls:Case Value="Squirrel"> |
| 75 | + <TextBlock FontSize="32">🐿</TextBlock> |
66 | 76 | </controls:Case> |
67 | 77 | </controls:SwitchPresenter> |
68 | 78 | </StackPanel> |
|
0 commit comments