Skip to content

Commit 828859a

Browse files
committed
Add DialogMargin to DialogHost, and make Shadow changeable (via Shadow.Assist). #420
1 parent b5723ed commit 828859a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

MaterialDesignThemes.Wpf/DialogHost.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,15 @@ public string DialogContentStringFormat
323323
set { SetValue(DialogContentStringFormatProperty, value); }
324324
}
325325

326+
public static readonly DependencyProperty DialogMarginProperty = DependencyProperty.Register(
327+
"DialogMargin", typeof(Thickness), typeof(DialogHost), new PropertyMetadata(default(Thickness)));
328+
329+
public Thickness DialogMargin
330+
{
331+
get { return (Thickness) GetValue(DialogMarginProperty); }
332+
set { SetValue(DialogMarginProperty, value); }
333+
}
334+
326335
public static readonly DependencyProperty OpenDialogCommandDataContextSourceProperty = DependencyProperty.Register(
327336
nameof(OpenDialogCommandDataContextSource), typeof (DialogHostOpenDialogCommandDataContextSource), typeof (DialogHost), new PropertyMetadata(default(DialogHostOpenDialogCommandDataContextSource)));
328337

MaterialDesignThemes.Wpf/Themes/Generic.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@
468468
</Style>
469469

470470
<Style TargetType="{x:Type local:DialogHost}">
471+
<Setter Property="DialogMargin" Value="22" />
472+
<Setter Property="local:ShadowAssist.ShadowDepth" Value="Depth5" />
471473
<Setter Property="Template">
472474
<Setter.Value>
473475
<ControlTemplate TargetType="local:DialogHost">
@@ -603,7 +605,7 @@
603605
</controlzEx:PopupEx.Resources>
604606
<local:Card x:Name="PART_PopupContentElement"
605607
Margin="22"
606-
local:ShadowAssist.ShadowDepth="Depth5"
608+
local:ShadowAssist.ShadowDepth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:ShadowAssist.ShadowDepth)}"
607609
UniformCornerRadius="4"
608610
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
609611
TextElement.FontWeight="Regular"

0 commit comments

Comments
 (0)