File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Microsoft.Toolkit.Uwp.UI.Animations/Extensions Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,26 @@ public static AnimationSet Blur(
157157 animationSet . AddCompositionEffectAnimation ( blurBrush , blurAnimation , $ "{ blurName } .BlurAmount") ;
158158 }
159159
160+ if ( value == 0 )
161+ {
162+ animationSet . Completed += AnimationSet_Completed ;
163+ }
164+
160165 return animationSet ;
161166 }
167+
168+ private static void AnimationSet_Completed ( object sender , EventArgs e )
169+ {
170+ var animationSet = sender as AnimationSet ;
171+ animationSet . Completed -= AnimationSet_Completed ;
172+
173+ var spriteVisual = ElementCompositionPreview . GetElementChildVisual ( animationSet . Element ) as SpriteVisual ;
174+ var blurBrush = spriteVisual ? . Brush as CompositionEffectBrush ;
175+
176+ if ( blurBrush != null || blurBrush . Comment == "Blur" )
177+ {
178+ spriteVisual . Brush = null ;
179+ }
180+ }
162181 }
163182}
You can’t perform that action at this time.
0 commit comments