Generic.xaml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:ZUI="clr-namespace:CustomUI">
  5. <Style TargetType="{x:Type ZUI:ZGroupBox}">
  6. <Setter Property="Foreground" Value="Black" />
  7. <Setter Property="BorderBrush" Value="#D7DDE4" />
  8. <Setter Property="BorderThickness" Value="1" />
  9. <Setter Property="HeaderBackground" Value="#F5F7F9" />
  10. <Setter Property="HeaderPadding" Value="5" />
  11. <Setter Property="CornerRadius" Value="0" />
  12. <Setter Property="HorizontalHeaderAlignment" Value="Stretch" />
  13. <Setter Property="SnapsToDevicePixels" Value="True" />
  14. <Setter Property="UseLayoutRounding" Value="True" />
  15. <Setter Property="Template">
  16. <Setter.Value>
  17. <ControlTemplate TargetType="{x:Type ZUI:ZGroupBox}">
  18. <Border
  19. Background="{TemplateBinding Background}"
  20. BorderBrush="{TemplateBinding BorderBrush}"
  21. BorderThickness="{TemplateBinding BorderThickness}"
  22. CornerRadius="{TemplateBinding CornerRadius}"
  23. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  24. UseLayoutRounding="{TemplateBinding UseLayoutRounding}">
  25. <Grid SnapsToDevicePixels="True">
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="Auto" />
  28. <RowDefinition Height="*" />
  29. </Grid.RowDefinitions>
  30. <Border
  31. x:Name="Header"
  32. Grid.Row="0"
  33. Padding="{TemplateBinding HeaderPadding}"
  34. Background="{TemplateBinding HeaderBackground}"
  35. BorderBrush="{TemplateBinding BorderBrush}"
  36. BorderThickness="0,0,0,1"
  37. CornerRadius="{Binding CornerRadiusInner, RelativeSource={RelativeSource TemplatedParent}}"
  38. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  39. UseLayoutRounding="False">
  40. <ContentPresenter
  41. HorizontalAlignment="{TemplateBinding HorizontalHeaderAlignment}"
  42. Content="{TemplateBinding Header}"
  43. ContentSource="Header"
  44. ContentStringFormat="{TemplateBinding HeaderStringFormat}"
  45. ContentTemplate="{TemplateBinding HeaderTemplate}"
  46. RecognizesAccessKey="True"
  47. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  48. </Border>
  49. <ContentPresenter
  50. Grid.Row="1"
  51. Margin="{TemplateBinding Padding}"
  52. Content="{TemplateBinding Content}"
  53. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  54. ContentTemplate="{TemplateBinding ContentTemplate}"
  55. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  56. </Grid>
  57. </Border>
  58. </ControlTemplate>
  59. </Setter.Value>
  60. </Setter>
  61. </Style>
  62. </ResourceDictionary>