DialogBaseStyle.xaml 1.1 KB

123456789101112131415161718192021
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:hc="clr-namespace:HandyControl.Controls">
  4. <Style x:Key="DialogBaseStyle" TargetType="hc:Dialog">
  5. <Setter Property="Focusable" Value="False"/>
  6. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  7. <Setter Property="VerticalContentAlignment" Value="Center"/>
  8. <Setter Property="MaskBrush" Value="{DynamicResource DarkOpacityBrush}"/>
  9. <Setter Property="Template">
  10. <Setter.Value>
  11. <ControlTemplate TargetType="hc:Dialog">
  12. <Border x:Name="PART_BackElement" Background="{TemplateBinding MaskBrush}">
  13. <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  14. </Border>
  15. </ControlTemplate>
  16. </Setter.Value>
  17. </Setter>
  18. </Style>
  19. </ResourceDictionary>