You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 rivejä
3.3 KiB

  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:bpa="clr-namespace:BPA.UIControl">
  4. <ResourceDictionary.MergedDictionaries>
  5. <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/Resources/Default.xaml" />
  6. </ResourceDictionary.MergedDictionaries>
  7. <Style TargetType="bpa:MessageBoxContainer">
  8. <Setter Property="Background" Value="{DynamicResource DefaultBackground}" />
  9. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  10. <Setter Property="MaskBackground" Value="{DynamicResource DialogBackground}" />
  11. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  12. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  13. <Setter Property="SnapsToDevicePixels" Value="True" />
  14. <Setter Property="IsShow" Value="False" />
  15. <Setter Property="IsClosed" Value="True" />
  16. <Setter Property="Template">
  17. <Setter.Value>
  18. <ControlTemplate TargetType="{x:Type bpa:MessageBoxContainer}">
  19. <Grid>
  20. <ContentPresenter x:Name="PART_ContentPresenter"
  21. Panel.ZIndex="1"
  22. Focusable="False"
  23. RecognizesAccessKey="True"
  24. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  25. <bpa:Transition x:Name="Path_Transition"
  26. Panel.ZIndex="100"
  27. IsShow="{TemplateBinding IsShow}">
  28. <Border x:Name="PART_RootBorder" Background="{TemplateBinding MaskBackground}">
  29. <ContentPresenter x:Name="PART_DialogContentPresenter"
  30. Grid.Row="1"
  31. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  32. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  33. Content="{TemplateBinding DialogContent}"
  34. ContentSource="DialogContent"
  35. Focusable="True"
  36. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  37. </Border>
  38. </bpa:Transition>
  39. </Grid>
  40. <ControlTemplate.Triggers>
  41. <MultiTrigger>
  42. <MultiTrigger.Conditions>
  43. <Condition Property="IsShow" Value="False" />
  44. <Condition Property="IsClosed" Value="True" />
  45. </MultiTrigger.Conditions>
  46. <Setter TargetName="Path_Transition" Property="Panel.ZIndex" Value="0" />
  47. </MultiTrigger>
  48. </ControlTemplate.Triggers>
  49. </ControlTemplate>
  50. </Setter.Value>
  51. </Setter>
  52. </Style>
  53. </ResourceDictionary>