Skip to content

Commit e56afb6

Browse files
committed
Merge pull request #318 from negue/fix-visual-tree
fixes #317 - enabled live visual tree inside of Dialog/DrawerHost
2 parents 20d3ac9 + 18a8d24 commit e56afb6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

MaterialDesignThemes.Wpf/Themes/Generic.xaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,12 @@
632632
x:Name="ContentPresenter" Opacity="1"
633633
Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" />
634634
</AdornerDecorator>
635-
<Grid x:Name="PART_ContentCoverGrid" Background="Black" Opacity="0" IsHitTestVisible="False" Focusable="False" />
635+
<Grid x:Name="PART_ContentCoverGrid" Background="{x:Null}" Opacity="0" IsHitTestVisible="False" Focusable="False" />
636636
</Grid>
637637
<ControlTemplate.Triggers>
638638
<Trigger Property="IsOpen" Value="True">
639639
<Setter TargetName="ContentPresenter" Property="IsEnabled" Value="False" />
640+
<Setter TargetName="PART_ContentCoverGrid" Property="Background" Value="Black" />
640641
<Setter TargetName="PART_ContentCoverGrid" Property="IsHitTestVisible" Value="True" />
641642
</Trigger>
642643
</ControlTemplate.Triggers>
@@ -645,6 +646,8 @@
645646
</Setter>
646647
</Style>
647648

649+
<SolidColorBrush x:Key="BlackBackground" Color="Black" />
650+
648651
<Style TargetType="{x:Type local:DrawerHost}">
649652
<Setter Property="local:ShadowAssist.ShadowDepth" Value="Depth3" />
650653
<Setter Property="LeftDrawerBackground" Value="{DynamicResource MaterialDesignPaper}" />
@@ -672,6 +675,10 @@
672675
</EasingDoubleKeyFrame.EasingFunction>
673676
</EasingDoubleKeyFrame>
674677
</DoubleAnimationUsingKeyFrames>
678+
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover"
679+
Storyboard.TargetProperty="Background">
680+
<DiscreteObjectKeyFrame Value="{StaticResource BlackBackground}" KeyTime="0" />
681+
</ObjectAnimationUsingKeyFrames>
675682
</Storyboard>
676683
</VisualTransition>
677684
<VisualTransition From="AnyOpen" To="AllClosed">
@@ -697,6 +704,10 @@
697704
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="IsEnabled">
698705
<DiscreteBooleanKeyFrame Value="False" KeyTime="0" />
699706
</BooleanAnimationUsingKeyFrames>
707+
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_ContentCover"
708+
Storyboard.TargetProperty="Background">
709+
<DiscreteObjectKeyFrame Value="{StaticResource BlackBackground}" KeyTime="0" />
710+
</ObjectAnimationUsingKeyFrames>
700711
</Storyboard>
701712
</VisualState>
702713
<VisualState x:Name="AllClosed">
@@ -760,7 +771,7 @@
760771
x:Name="ContentPresenter" Opacity="1"
761772
Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" ContentStringFormat="{TemplateBinding ContentStringFormat}" />
762773
</AdornerDecorator>
763-
<Grid x:Name="PART_ContentCover" Background="Black" Opacity="0" IsHitTestVisible="False" Focusable="False" />
774+
<Grid x:Name="PART_ContentCover" Background="{x:Null}" Opacity="0" IsHitTestVisible="False" Focusable="False" />
764775
<Grid HorizontalAlignment="Left" VerticalAlignment="Stretch">
765776
<Grid.RenderTransform>
766777
<TranslateTransform x:Name="LeftDrawerTranslateTransform"

0 commit comments

Comments
 (0)