Skip to content

Commit 8e31fd9

Browse files
committed
Disabled animations for platforms other than (modern) Windows
1 parent cb812ad commit 8e31fd9

1 file changed

Lines changed: 33 additions & 11 deletions

File tree

src/Codebreaker.Uno/CodebreakerUno/Views/Components/GameResultDisplay.xaml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
8+
xmlns:non_win="http://uno.ui/not_win"
79
xmlns:animations="using:CommunityToolkit.WinUI.Animations"
810
xmlns:converter="using:CodeBreaker.Uno.Converters"
911
xmlns:cme="using:CodeBreaker.Uno.CustomMarkupExtensions"
10-
mc:Ignorable="d"
12+
mc:Ignorable="d non_win"
1113
d:DesignHeight="300"
1214
d:DesignWidth="400">
1315
<UserControl.Resources>
@@ -22,21 +24,41 @@
2224
</animations:ImplicitAnimationSet>
2325
</UserControl.Resources>
2426
<Grid>
25-
<StackPanel Orientation="Vertical"
26-
Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Won}"
27-
animations:Implicit.ShowAnimations="{StaticResource EntranceAnimation}"
28-
animations:Implicit.HideAnimations="{StaticResource ExitAnimation}">
27+
<!-- Won - (Modern) Windows -->
28+
<win:StackPanel
29+
Orientation="Vertical"
30+
Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Won}"
31+
animations:Implicit.ShowAnimations="{StaticResource EntranceAnimation}"
32+
animations:Implicit.HideAnimations="{StaticResource ExitAnimation}">
2933
<Image Source="ms-appx:///Assets/Animations/WonAnimation_300_opt.gif" MaxHeight="300" />
3034
<TextBlock Text="{cme:ResourceString Name=GamePage_WonMessage}" FontSize="{ThemeResource TextStyleExtraLargeFontSize}" HorizontalAlignment="Center" Margin="0,50,0,20" />
3135
<Button Content="{cme:ResourceString Name=GamePage_WonButtonText}" HorizontalAlignment="Center" Margin="0,0,0,100" Command="{x:Bind ViewModel.StartGameCommand, Mode=OneTime}" />
32-
</StackPanel>
33-
<StackPanel Orientation="Vertical"
34-
Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Lost}"
35-
animations:Implicit.ShowAnimations="{StaticResource EntranceAnimation}"
36-
animations:Implicit.HideAnimations="{StaticResource ExitAnimation}">
36+
</win:StackPanel>
37+
<!-- Won - Other Platforms -->
38+
<non_win:StackPanel
39+
Orientation="Vertical"
40+
Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Won}">
41+
<Image Source="ms-appx:///Assets/Animations/WonAnimation_300_opt.gif" MaxHeight="300" />
42+
<TextBlock Text="{cme:ResourceString Name=GamePage_WonMessage}" FontSize="{ThemeResource TextStyleExtraLargeFontSize}" HorizontalAlignment="Center" Margin="0,50,0,20" />
43+
<Button Content="{cme:ResourceString Name=GamePage_WonButtonText}" HorizontalAlignment="Center" Margin="0,0,0,100" Command="{x:Bind ViewModel.StartGameCommand, Mode=OneTime}" />
44+
</non_win:StackPanel>
45+
<!-- Lost - (Modern) Windows -->
46+
<win:StackPanel
47+
Orientation="Vertical"
48+
Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Lost}"
49+
animations:Implicit.ShowAnimations="{StaticResource EntranceAnimation}"
50+
animations:Implicit.HideAnimations="{StaticResource ExitAnimation}">
51+
<Image Source="ms-appx:///Assets/Animations/LostAnimation_300_opt.gif" MaxHeight="300" />
52+
<TextBlock Text="{cme:ResourceString Name=GamePage_LostMessage}" FontSize="{ThemeResource TextStyleExtraLargeFontSize}" HorizontalAlignment="Center" Margin="0,50,0,20" />
53+
<Button Content="{cme:ResourceString Name=GamePage_LostButtonText}" HorizontalAlignment="Center" Margin="0,0,0,100" Command="{x:Bind ViewModel.StartGameCommand, Mode=OneTime}" />
54+
</win:StackPanel>
55+
<!-- Lost - Other Platforms -->
56+
<non_win:StackPanel
57+
Orientation="Vertical"
58+
Visibility="{x:Bind ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToVisibilityConverter}, ConverterParameter=Lost}">
3759
<Image Source="ms-appx:///Assets/Animations/LostAnimation_300_opt.gif" MaxHeight="300" />
3860
<TextBlock Text="{cme:ResourceString Name=GamePage_LostMessage}" FontSize="{ThemeResource TextStyleExtraLargeFontSize}" HorizontalAlignment="Center" Margin="0,50,0,20" />
3961
<Button Content="{cme:ResourceString Name=GamePage_LostButtonText}" HorizontalAlignment="Center" Margin="0,0,0,100" Command="{x:Bind ViewModel.StartGameCommand, Mode=OneTime}" />
40-
</StackPanel>
62+
</non_win:StackPanel>
4163
</Grid>
4264
</UserControl>

0 commit comments

Comments
 (0)