|
24 | 24 | </animations:ImplicitAnimationSet> |
25 | 25 | </UserControl.Resources> |
26 | 26 | <Grid> |
| 27 | + <VisualStateManager.VisualStateGroups> |
| 28 | + <VisualStateGroup> |
| 29 | + <VisualState x:Name="Default"> |
| 30 | + <VisualState.Setters> |
| 31 | + <Setter Target="WonPanel.Visibility" Value="Collapsed" /> |
| 32 | + <Setter Target="LostPanel.Visibility" Value="Collapsed" /> |
| 33 | + </VisualState.Setters> |
| 34 | + </VisualState> |
| 35 | + <VisualState x:Name="Won"> |
| 36 | + <VisualState.Setters> |
| 37 | + <Setter Target="WonPanel.Visibility" Value="Visible" /> |
| 38 | + <Setter Target="LostPanel.Visibility" Value="Collapsed" /> |
| 39 | + </VisualState.Setters> |
| 40 | + </VisualState> |
| 41 | + <VisualState x:Name="Lost"> |
| 42 | + <VisualState.Setters> |
| 43 | + <Setter Target="WonPanel.Visibility" Value="Collapsed" /> |
| 44 | + <Setter Target="LostPanel.Visibility" Value="Visible" /> |
| 45 | + </VisualState.Setters> |
| 46 | + </VisualState> |
| 47 | + </VisualStateGroup> |
| 48 | + </VisualStateManager.VisualStateGroups> |
27 | 49 | <!-- Won - (Modern) Windows --> |
28 | 50 | <win:StackPanel |
| 51 | + x:Name="WonPanel" |
29 | 52 | Orientation="Vertical" |
30 | | - Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Won}" |
31 | 53 | animations:Implicit.ShowAnimations="{StaticResource EntranceAnimation}" |
32 | 54 | animations:Implicit.HideAnimations="{StaticResource ExitAnimation}"> |
33 | 55 | <Image Source="ms-appx:///Assets/Animations/WonAnimation_300_opt.gif" MaxHeight="300" /> |
|
36 | 58 | </win:StackPanel> |
37 | 59 | <!-- Won - Other Platforms --> |
38 | 60 | <not_win:StackPanel |
39 | | - Orientation="Vertical" |
40 | | - Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Won}"> |
| 61 | + x:Name="WonPanel" |
| 62 | + Orientation="Vertical"> |
41 | 63 | <Image Source="ms-appx:///Assets/Animations/WonAnimation_300_opt.gif" MaxHeight="300" /> |
42 | 64 | <TextBlock Text="{cme:ResourceString Name=GamePage_WonMessage}" FontSize="{ThemeResource TextStyleExtraLargeFontSize}" HorizontalAlignment="Center" Margin="0,50,0,20" /> |
43 | 65 | <Button Content="{cme:ResourceString Name=GamePage_WonButtonText}" HorizontalAlignment="Center" Margin="0,0,0,100" Command="{x:Bind ViewModel.StartGameCommand, Mode=OneTime}" /> |
44 | 66 | </not_win:StackPanel> |
45 | 67 | <!-- Lost - (Modern) Windows --> |
46 | 68 | <win:StackPanel |
| 69 | + x:Name="LostPanel" |
47 | 70 | Orientation="Vertical" |
48 | | - Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Lost}" |
49 | 71 | animations:Implicit.ShowAnimations="{StaticResource EntranceAnimation}" |
50 | 72 | animations:Implicit.HideAnimations="{StaticResource ExitAnimation}"> |
51 | 73 | <Image Source="ms-appx:///Assets/Animations/LostAnimation_300_opt.gif" MaxHeight="300" /> |
|
54 | 76 | </win:StackPanel> |
55 | 77 | <!-- Lost - Other Platforms --> |
56 | 78 | <not_win:StackPanel |
57 | | - Orientation="Vertical" |
58 | | - Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Lost}"> |
| 79 | + x:Name="LostPanel" |
| 80 | + Orientation="Vertical"> |
59 | 81 | <Image Source="ms-appx:///Assets/Animations/LostAnimation_300_opt.gif" MaxHeight="300" /> |
60 | 82 | <TextBlock Text="{cme:ResourceString Name=GamePage_LostMessage}" FontSize="{ThemeResource TextStyleExtraLargeFontSize}" HorizontalAlignment="Center" Margin="0,50,0,20" /> |
61 | 83 | <Button Content="{cme:ResourceString Name=GamePage_LostButtonText}" HorizontalAlignment="Center" Margin="0,0,0,100" Command="{x:Bind ViewModel.StartGameCommand, Mode=OneTime}" /> |
|
0 commit comments