Skip to content

Commit 7aee58b

Browse files
author
Helder Carvalho
committed
Betteer Fix #329
1 parent f18301d commit 7aee58b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

MaterialDesignThemes.Wpf/PopupBox.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,12 @@ private void AnimateChildrenIn(bool reverse)
579579
uiElement.SetCurrentValue(RenderTransformOriginProperty, new Point(.5, .5));
580580
uiElement.RenderTransform = transformGroup;
581581

582+
var opacityAnimation = new DoubleAnimationUsingKeyFrames();
583+
opacityAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(0, absoluteZeroKeyTime, sineEase));
584+
opacityAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(0, deferredStartKeyTime, sineEase));
585+
opacityAnimation.KeyFrames.Add(new EasingDoubleKeyFrame((double)uiElement.GetAnimationBaseValue(OpacityProperty), deferredEndKeyTime, sineEase));
586+
Storyboard.SetTargetProperty(opacityAnimation, new PropertyPath("Opacity"));
587+
Storyboard.SetTarget(opacityAnimation, uiElement);
582588

583589
var scaleXAnimation = new DoubleAnimationUsingKeyFrames();
584590
scaleXAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(0, absoluteZeroKeyTime, sineEase));
@@ -603,6 +609,8 @@ private void AnimateChildrenIn(bool reverse)
603609
Storyboard.SetTarget(translateCoordinateAnimation, uiElement);
604610

605611
var storyboard = new Storyboard();
612+
613+
storyboard.Children.Add(opacityAnimation);
606614
storyboard.Children.Add(scaleXAnimation);
607615
storyboard.Children.Add(scaleYAnimation);
608616
storyboard.Children.Add(translateCoordinateAnimation);
@@ -613,7 +621,6 @@ private void AnimateChildrenIn(bool reverse)
613621
storyboard.Begin();
614622
storyboard.Seek(TimeSpan.FromMilliseconds(deferredEnd));
615623
storyboard.Resume();
616-
617624
}
618625
else
619626
storyboard.Begin();

0 commit comments

Comments
 (0)