@@ -129,6 +129,12 @@ public static void SetAnimations(UIElement element, ImplicitAnimationSet value)
129
129
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
130
130
private static void OnShowAnimationsPropertyChanged ( DependencyObject d , DependencyPropertyChangedEventArgs e )
131
131
{
132
+ // See https://github.com/CommunityToolkit/Windows/issues/319
133
+ #if HAS_UNO
134
+ #pragma warning disable CS0162
135
+ return ;
136
+ #endif
137
+
132
138
static void OnAnimationsChanged ( object sender , EventArgs e )
133
139
{
134
140
var collection = ( ImplicitAnimationSet ) sender ;
@@ -160,6 +166,10 @@ static void OnAnimationsChanged(object sender, EventArgs e)
160
166
ElementCompositionPreview . SetImplicitShowAnimation ( element , null ) ;
161
167
}
162
168
}
169
+
170
+ #if HAS_UNO
171
+ #pragma warning restore CS0162
172
+ #endif
163
173
}
164
174
165
175
/// <summary>
@@ -169,6 +179,12 @@ static void OnAnimationsChanged(object sender, EventArgs e)
169
179
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
170
180
private static void OnHideAnimationsPropertyChanged ( DependencyObject d , DependencyPropertyChangedEventArgs e )
171
181
{
182
+ // See https://github.com/CommunityToolkit/Windows/issues/319
183
+ #if HAS_UNO
184
+ #pragma warning disable CS0162
185
+ return ;
186
+ #endif
187
+
172
188
static void OnAnimationsChanged ( object sender , EventArgs e )
173
189
{
174
190
var collection = ( ImplicitAnimationSet ) sender ;
@@ -200,6 +216,10 @@ static void OnAnimationsChanged(object sender, EventArgs e)
200
216
ElementCompositionPreview . SetImplicitHideAnimation ( element , null ) ;
201
217
}
202
218
}
219
+
220
+ #if HAS_UNO
221
+ #pragma warning restore CS0162
222
+ #endif
203
223
}
204
224
205
225
/// <summary>
@@ -209,6 +229,12 @@ static void OnAnimationsChanged(object sender, EventArgs e)
209
229
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
210
230
private static void OnAnimationsPropertyChanged ( DependencyObject d , DependencyPropertyChangedEventArgs e )
211
231
{
232
+ // See https://github.com/CommunityToolkit/Windows/issues/319
233
+ #if HAS_UNO
234
+ #pragma warning disable CS0162
235
+ return ;
236
+ #endif
237
+
212
238
static void OnAnimationsChanged ( object sender , EventArgs e )
213
239
{
214
240
var collection = ( ImplicitAnimationSet ) sender ;
@@ -240,5 +266,9 @@ static void OnAnimationsChanged(object sender, EventArgs e)
240
266
ElementCompositionPreview . GetElementVisual ( element ) . ImplicitAnimations = null ;
241
267
}
242
268
}
269
+
270
+ #if HAS_UNO
271
+ #pragma warning restore CS0162
272
+ #endif
243
273
}
244
274
}
0 commit comments