Skip to content

Commit 36c53cc

Browse files
committed
[AOT] Fix ColorShadow animation in NAOT
1 parent 23a2e98 commit 36c53cc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dev/DevWinUI.Controls/Controls/Composition/ColorShadow/ColorShadow.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public partial class ColorShadow : Control
3030
private SpriteVisual _imageVisual;
3131
private CompositionEffectBrush _colorShadowBrush;
3232
private DropShadow _dropShadow;
33-
private KeyFrameAnimation<float> _colorShadowBlurAnimation;
34-
readonly ImageSurfaceOptions _maskOptions = ImageSurfaceOptions.DefaultImageMaskOptions;
33+
private ScalarKeyFrameAnimation _colorShadowBlurAnimation;
34+
private readonly ImageSurfaceOptions _maskOptions = ImageSurfaceOptions.DefaultImageMaskOptions;
3535

3636
private Grid _renderGrid;
3737
private bool _imageSourceLoaded;
@@ -203,7 +203,9 @@ void CreateShadowMask()
203203
_colorShadowVisual.Brush = _colorShadowBrush;
204204
_colorShadowVisual.Opacity = ColorShadowOpacity.ToSingle();
205205

206-
_colorShadowBlurAnimation = _compositor.GenerateScalarKeyFrameAnimation().HavingDuration(TimeSpan.FromMilliseconds(100));
206+
_colorShadowBlurAnimation = _compositor.CreateScalarKeyFrameAnimation();
207+
_colorShadowBlurAnimation.Duration = TimeSpan.FromMilliseconds(100);
208+
207209
Expression<CompositionExpression<float>> expr = c => ColorShadowBlurRadius.ToSingle();
208210
_colorShadowBlurAnimation.InsertExpressionKeyFrame(1f, expr, _compositor.CreateLinearEasingFunction());
209211
_colorShadowBrush.Properties.StartAnimation("Blur.BlurAmount", _colorShadowBlurAnimation);

0 commit comments

Comments
 (0)