Skip to content

Commit b10add3

Browse files
committed
Merge branch 'fixIssue655' of https://github.com/Keboo/MaterialDesignInXamlToolkit into Keboo-fixIssue655master
2 parents 31e0dc6 + 1e73c07 commit b10add3

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

MaterialDesignThemes.Wpf/DialogHost.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,15 @@ public SnackbarMessageQueue SnackbarMessageQueue
411411
set { SetValue(SnackbarMessageQueueProperty, value); }
412412
}
413413

414+
public static readonly DependencyProperty PopupStyleProperty = DependencyProperty.Register(
415+
nameof(PopupStyle), typeof(Style), typeof(DialogHost), new PropertyMetadata(default(Style)));
416+
417+
public Style PopupStyle
418+
{
419+
get { return (Style) GetValue(PopupStyleProperty); }
420+
set { SetValue(PopupStyleProperty, value); }
421+
}
422+
414423
public override void OnApplyTemplate()
415424
{
416425
if (_contentCoverGrid != null)

MaterialDesignThemes.Wpf/Themes/Generic.xaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,17 @@
482482
</Style.Triggers>
483483
</Style>
484484

485+
<Style x:Key="MaterialDesignDialogHostPopup" TargetType="{x:Type controlzEx:PopupEx}">
486+
<Setter Property="StaysOpen" Value="True" />
487+
<Setter Property="AllowsTransparency" Value="True" />
488+
<Setter Property="PopupAnimation" Value="None" />
489+
<Setter Property="Placement" Value="Center" />
490+
</Style>
491+
485492
<Style TargetType="{x:Type local:DialogHost}">
486493
<Setter Property="DialogMargin" Value="22" />
487494
<Setter Property="local:ShadowAssist.ShadowDepth" Value="Depth5" />
495+
<Setter Property="PopupStyle" Value="{StaticResource MaterialDesignDialogHostPopup}" />
488496
<Setter Property="Template">
489497
<Setter.Value>
490498
<ControlTemplate TargetType="local:DialogHost">
@@ -602,13 +610,9 @@
602610
</VisualState>
603611
</VisualStateGroup>
604612
</VisualStateManager.VisualStateGroups>
605-
<controlzEx:PopupEx IsOpen="False"
606-
PlacementTarget="{Binding ElementName=DialogHostRoot, Mode=OneWay}"
607-
StaysOpen="True"
608-
AllowsTransparency="True"
609-
PopupAnimation="None"
610-
x:Name="PART_Popup"
611-
Placement="Center">
613+
<controlzEx:PopupEx PlacementTarget="{Binding ElementName=DialogHostRoot, Mode=OneWay}"
614+
x:Name="PART_Popup"
615+
Style="{TemplateBinding PopupStyle}">
612616
<controlzEx:PopupEx.Resources>
613617
<ResourceDictionary>
614618
<ResourceDictionary.MergedDictionaries>

0 commit comments

Comments
 (0)