Skip to content

Commit 20c5a28

Browse files
committed
Excluded connected animations from platforms other than Windows 10+
1 parent cc1d6ff commit 20c5a28

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/Codebreaker.Uno/CodebreakerUno/Views/Components/PegSelectionComponent.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using Codebreaker.ViewModels;
22
using CodeBreaker.Uno.Helpers;
33
using CommunityToolkit.Mvvm.Messaging;
4+
#if WINDOWS10_0_17763_0_OR_GREATER
45
using Microsoft.UI.Xaml.Media.Animation;
6+
#endif
57

68
namespace CodeBreaker.Uno.Views.Components;
79

@@ -31,11 +33,13 @@ private static void OnViewModelChanged(DependencyObject dependencyObject, Depend
3133

3234
public void Receive(GameMoveMessage message)
3335
{
36+
#if WINDOWS10_0_17763_0_OR_GREATER
3437
if (message.GameMoveValue is not GameMoveValue.Started)
3538
return;
3639

3740
var animationService = ConnectedAnimationService.GetForCurrentView();
3841
this.FindItemsOfType<ComboBox>(this)
3942
.ForEach((i, comboBox) => animationService.PrepareToAnimate($"guess{i}", comboBox));
43+
#endif
4044
}
4145
}

src/Codebreaker.Uno/CodebreakerUno/Views/Pages/GamePage.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using Codebreaker.ViewModels;
22
using CodeBreaker.Uno.Helpers;
33
using CommunityToolkit.Mvvm.Messaging;
4+
#if WINDOWS10_0_17763_0_OR_GREATER
45
using Microsoft.UI.Xaml.Media.Animation;
56
using Microsoft.UI.Xaml.Shapes;
7+
#endif
68

79
namespace CodeBreaker.Uno.Views.Pages;
810

@@ -28,6 +30,7 @@ public void Receive(GameMoveMessage message)
2830
if (message.GameMoveValue is not GameMoveValue.Completed)
2931
return;
3032

33+
#if WINDOWS10_0_17763_0_OR_GREATER
3134
var selectionAndKeyPegs = message.SelectionAndKeyPegs ?? throw new InvalidOperationException();
3235
var animationService = ConnectedAnimationService.GetForCurrentView();
3336
animationService.DefaultDuration = TimeSpan.FromMilliseconds(500);
@@ -44,6 +47,7 @@ public void Receive(GameMoveMessage message)
4447
animation.Configuration = new BasicConnectedAnimationConfiguration();
4548
animation.TryStart(ellipse);
4649
});
50+
#endif
4751

4852
// Scroll to bottom
4953
PegScrollViewer.UpdateLayout();

0 commit comments

Comments
 (0)