Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

105 строки
7.2 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 x:Key="RubyerDescriptionItem" TargetType="{x:Type bpa:DescriptionItem}">
  8. <Setter Property="BorderBrush" Value="{Binding BorderBrush, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  9. <Setter Property="Padding" Value="{Binding Padding, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  10. <Setter Property="Focusable" Value="False" />
  11. <Setter Property="Background" Value="Transparent" />
  12. <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  13. <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  14. <Setter Property="DescriptionBackground" Value="{Binding DescriptionBackground, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  15. <Setter Property="DescriptionForeground" Value="{Binding DescriptionForeground, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  16. <Setter Property="DescriptionFontSize" Value="{Binding DescriptionFontSize, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  17. <Setter Property="DescriptionFontWeight" Value="{Binding DescriptionFontWeight, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  18. <Setter Property="HorizontalDescriptionAlignment" Value="{Binding HorizontalDescriptionAlignment, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  19. <Setter Property="VerticalDescriptionAlignment" Value="{Binding VerticalDescriptionAlignment, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  20. <Setter Property="Template">
  21. <Setter.Value>
  22. <ControlTemplate TargetType="{x:Type bpa:DescriptionItem}">
  23. <Grid>
  24. <Grid.ColumnDefinitions>
  25. <ColumnDefinition Width="{TemplateBinding DescriptionWidth}" />
  26. <ColumnDefinition Width="*" />
  27. </Grid.ColumnDefinitions>
  28. <Border x:Name="descriptionBorder"
  29. Background="{TemplateBinding DescriptionBackground}"
  30. BorderBrush="{TemplateBinding BorderBrush}"
  31. BorderThickness="{TemplateBinding DescriptionBorderThickness}">
  32. <ContentControl x:Name="descriptionContent"
  33. Margin="{TemplateBinding Padding}"
  34. HorizontalAlignment="{TemplateBinding HorizontalDescriptionAlignment}"
  35. VerticalAlignment="{TemplateBinding VerticalDescriptionAlignment}"
  36. Content="{TemplateBinding Description}"
  37. Focusable="False"
  38. FontSize="{TemplateBinding DescriptionFontSize}"
  39. FontWeight="{TemplateBinding DescriptionFontWeight}"
  40. Foreground="{TemplateBinding DescriptionForeground}"
  41. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  42. </Border>
  43. <Border x:Name="contentBorder"
  44. Grid.Column="1"
  45. Background="{TemplateBinding Background}"
  46. BorderBrush="{TemplateBinding BorderBrush}"
  47. BorderThickness="{TemplateBinding ContentBorderThickness}">
  48. <ContentPresenter x:Name="contentPresenter"
  49. Margin="{TemplateBinding Padding}"
  50. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  51. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  52. Focusable="False"
  53. RecognizesAccessKey="True"
  54. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  55. </Border>
  56. </Grid>
  57. </ControlTemplate>
  58. </Setter.Value>
  59. </Setter>
  60. </Style>
  61. <Style x:Key="RubyerDescription" TargetType="{x:Type bpa:Description}">
  62. <Setter Property="BorderThickness" Value="0" />
  63. <Setter Property="BorderBrush" Value="{DynamicResource Border}" />
  64. <Setter Property="Padding" Value="10 5" />
  65. <Setter Property="Columns" Value="1" />
  66. <Setter Property="DescriptionBackground" Value="Transparent" />
  67. <Setter Property="DescriptionForeground" Value="{DynamicResource DefaultForeground}" />
  68. <Setter Property="SnapsToDevicePixels" Value="True" />
  69. <Setter Property="VerticalContentAlignment" Value="Center" />
  70. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  71. <Setter Property="VerticalDescriptionAlignment" Value="Center" />
  72. <Setter Property="HorizontalDescriptionAlignment" Value="Stretch" />
  73. <Setter Property="DescriptionFontWeight" Value="Normal" />
  74. <Setter Property="DescriptionFontSize" Value="{Binding FontSize, RelativeSource={RelativeSource Self}}" />
  75. <Setter Property="Focusable" Value="False" />
  76. <Setter Property="ItemsPanel">
  77. <Setter.Value>
  78. <ItemsPanelTemplate>
  79. <Grid bpa:GridHelper.Columns="{Binding Columns, RelativeSource={RelativeSource AncestorType=bpa:Description}}" bpa:GridHelper.Rows="{Binding Rows, RelativeSource={RelativeSource AncestorType=bpa:Description}}" />
  80. </ItemsPanelTemplate>
  81. </Setter.Value>
  82. </Setter>
  83. <Setter Property="Template">
  84. <Setter.Value>
  85. <ControlTemplate TargetType="{x:Type bpa:Description}">
  86. <Border Background="{TemplateBinding Background}"
  87. BorderBrush="{TemplateBinding BorderBrush}"
  88. BorderThickness="{TemplateBinding BorderThickness}">
  89. <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  90. </Border>
  91. </ControlTemplate>
  92. </Setter.Value>
  93. </Setter>
  94. </Style>
  95. <Style x:Key="BorderDescription"
  96. BasedOn="{StaticResource RubyerDescription}"
  97. TargetType="{x:Type bpa:Description}">
  98. <Setter Property="BorderThickness" Value="{DynamicResource DefaultBorderThickness}" />
  99. <Setter Property="DescriptionBackground" Value="{DynamicResource HeaderBackground}" />
  100. </Style>
  101. </ResourceDictionary>