File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
dev/DevWinUI.Controls/Controls/Composition/ColorShadow Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments