Skip to content

Commit 62e1e21

Browse files
committed
Merge pull request #386 from CarHel/master
Fixed #329
2 parents b905201 + 809eb74 commit 62e1e21

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

MainDemo.Wpf/Buttons.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
Opened="PopupBox_OnOpened"
8585
Closed="PopupBox_OnClosed">
8686
<StackPanel>
87-
<Button ToolTip="One">1</Button>
87+
<Button ToolTip="One with custom opacity" Opacity="0.5">1 </Button>
8888
<Button ToolTip="Two">2</Button>
8989
<Button ToolTip="Three">3</Button>
9090
</StackPanel>
@@ -146,7 +146,7 @@
146146
</materialDesign:PopupBox.ToggleCheckedContent>
147147
<StackPanel>
148148
<Button ToolTip="One">1</Button>
149-
<Button ToolTip="Two">2</Button>
149+
<Button ToolTip="Two" IsEnabled="False">2</Button>
150150
<Button ToolTip="Three">3</Button>
151151
</StackPanel>
152152
</materialDesign:PopupBox>

MaterialDesignThemes.Wpf/PopupBox.cs

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

582-
var opacityAnimation = new DoubleAnimationUsingKeyFrames();
582+
var opacityAnimation = new DoubleAnimationUsingKeyFrames();
583583
opacityAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(0, absoluteZeroKeyTime, sineEase));
584584
opacityAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(0, deferredStartKeyTime, sineEase));
585-
opacityAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(1, deferredEndKeyTime, sineEase));
585+
opacityAnimation.KeyFrames.Add(new EasingDoubleKeyFrame((double)uiElement.GetAnimationBaseValue(OpacityProperty), deferredEndKeyTime, sineEase));
586586
Storyboard.SetTargetProperty(opacityAnimation, new PropertyPath("Opacity"));
587587
Storyboard.SetTarget(opacityAnimation, uiElement);
588588

@@ -609,6 +609,7 @@ private void AnimateChildrenIn(bool reverse)
609609
Storyboard.SetTarget(translateCoordinateAnimation, uiElement);
610610

611611
var storyboard = new Storyboard();
612+
612613
storyboard.Children.Add(opacityAnimation);
613614
storyboard.Children.Add(scaleXAnimation);
614615
storyboard.Children.Add(scaleYAnimation);
@@ -620,7 +621,6 @@ private void AnimateChildrenIn(bool reverse)
620621
storyboard.Begin();
621622
storyboard.Seek(TimeSpan.FromMilliseconds(deferredEnd));
622623
storyboard.Resume();
623-
624624
}
625625
else
626626
storyboard.Begin();

0 commit comments

Comments
 (0)