Skip to content

Commit

Permalink
(GH-3605) Fix HamburgerMenu: Previous view controls can still be clic…
Browse files Browse the repository at this point in the history
…ked.

This issue is caused by the previous fix for the TransitioningContentControl (32d263c). If setting the Visibility for the Normal state to collapsed it can produce empty content. To avoid this issue is necessary to set it to Hidden.
  • Loading branch information
punker76 committed Sep 16, 2019
1 parent 873717f commit e59402c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/MahApps.Metro/Controls/TransitioningContentControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ protected override void OnContentChanged(object oldContent, object newContent)
{
base.OnContentChanged(oldContent, newContent);

this.StartTransition(oldContent, newContent);
if (oldContent != newContent)
{
this.StartTransition(oldContent, newContent);

}
}

[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "newContent", Justification = "Should be used in the future.")]
Expand Down
12 changes: 8 additions & 4 deletions src/MahApps.Metro/Themes/TransitioningContentControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,15 @@

<VisualState x:Name="Normal">
<Storyboard>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="PreviousContentPresentationSite"
Storyboard.TargetProperty="(UIElement.Opacity)">
<LinearDoubleKeyFrame KeyTime="00:00:00" Value="0" />
</DoubleAnimationUsingKeyFrames>
Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00">
<DiscreteObjectKeyFrame.Value>
<Visibility>Hidden</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>

Expand Down

0 comments on commit e59402c

Please sign in to comment.