diff --git a/components/Animations/src/Implicit.cs b/components/Animations/src/Implicit.cs index 692daabb..8e4fc90d 100644 --- a/components/Animations/src/Implicit.cs +++ b/components/Animations/src/Implicit.cs @@ -129,6 +129,12 @@ public static void SetAnimations(UIElement element, ImplicitAnimationSet value) /// The instance for the current event. private static void OnShowAnimationsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { + // See https://github.com/CommunityToolkit/Windows/issues/319 + #if HAS_UNO + #pragma warning disable CS0162 + return; + #endif + static void OnAnimationsChanged(object sender, EventArgs e) { var collection = (ImplicitAnimationSet)sender; @@ -160,6 +166,10 @@ static void OnAnimationsChanged(object sender, EventArgs e) ElementCompositionPreview.SetImplicitShowAnimation(element, null); } } + + #if HAS_UNO + #pragma warning restore CS0162 + #endif } /// @@ -169,6 +179,12 @@ static void OnAnimationsChanged(object sender, EventArgs e) /// The instance for the current event. private static void OnHideAnimationsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { + // See https://github.com/CommunityToolkit/Windows/issues/319 + #if HAS_UNO + #pragma warning disable CS0162 + return; + #endif + static void OnAnimationsChanged(object sender, EventArgs e) { var collection = (ImplicitAnimationSet)sender; @@ -200,6 +216,10 @@ static void OnAnimationsChanged(object sender, EventArgs e) ElementCompositionPreview.SetImplicitHideAnimation(element, null); } } + + #if HAS_UNO + #pragma warning restore CS0162 + #endif } /// @@ -209,6 +229,12 @@ static void OnAnimationsChanged(object sender, EventArgs e) /// The instance for the current event. private static void OnAnimationsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { + // See https://github.com/CommunityToolkit/Windows/issues/319 + #if HAS_UNO + #pragma warning disable CS0162 + return; + #endif + static void OnAnimationsChanged(object sender, EventArgs e) { var collection = (ImplicitAnimationSet)sender; @@ -240,5 +266,9 @@ static void OnAnimationsChanged(object sender, EventArgs e) ElementCompositionPreview.GetElementVisual(element).ImplicitAnimations = null; } } + + #if HAS_UNO + #pragma warning restore CS0162 + #endif } }