MainStyle.xaml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <!-- Кнопки скрытия, свертывания и закрытия -->
  4. <Style x:Key="NavViewButtonsStyle" TargetType="{x:Type Button}">
  5. <Setter Property="Background" Value="Transparent"/>
  6. <Setter Property="Foreground" Value="{DynamicResource PrimaryHomingTwoColor}"/>
  7. <Setter Property="FontWeight" Value="Bold"/>
  8. <Setter Property="Cursor" Value="Hand"/>
  9. <Setter Property="FontSize" Value="16"/>
  10. <Setter Property="BorderThickness" Value="0"/>
  11. <Setter Property="Height" Value="25"/>
  12. <Setter Property="Width" Value="25"/>
  13. <Setter Property="Template">
  14. <Setter.Value>
  15. <ControlTemplate TargetType="{x:Type Button}">
  16. <Border BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="5" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  17. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  18. </Border>
  19. </ControlTemplate>
  20. </Setter.Value>
  21. </Setter>
  22. <Style.Triggers>
  23. <Trigger Property="IsMouseOver" Value="True">
  24. <Setter Property="Background" Value="{DynamicResource SecundaryBackgroundColor}"/>
  25. </Trigger>
  26. <MultiTrigger>
  27. <MultiTrigger.Conditions>
  28. <Condition Property="IsMouseOver" Value="True"/>
  29. <Condition Property="Tag" Value="IsCloseButton"/>
  30. </MultiTrigger.Conditions>
  31. <Setter Property="Background" Value="{DynamicResource btnClose}"/>
  32. </MultiTrigger>
  33. <Trigger Property="IsPressed" Value="True">
  34. <Setter Property="Background" Value="{DynamicResource SecundaryBackgroundColor}"/>
  35. </Trigger>
  36. </Style.Triggers>
  37. </Style>
  38. <!-- Отделы -->
  39. <Style TargetType="{x:Type Button}">
  40. <Setter Property="Cursor" Value="Hand"/>
  41. <Setter Property="Padding" Value="5"/>
  42. <Setter Property="Margin" Value="5"/>
  43. <Setter Property="Height" Value="30"/>
  44. <Setter Property="Background" Value="{DynamicResource PrimaryBackgroundColor}"/>
  45. <Setter Property="Foreground" Value="{DynamicResource PrimaryHomingTwoColor}" />
  46. <Setter Property="FontSize" Value="12"/>
  47. <Setter Property="BorderThickness" Value="0" />
  48. <Setter Property="Template">
  49. <Setter.Value>
  50. <ControlTemplate TargetType="{x:Type Button}">
  51. <Border BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="5"
  52. BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  53. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  54. </Border>
  55. </ControlTemplate>
  56. </Setter.Value>
  57. </Setter>
  58. <Style.Triggers>
  59. <Trigger Property="IsMouseOver" Value="True">
  60. <Setter Property="Background" Value="{DynamicResource PrimaryHomingColor}"/>
  61. <Setter Property="Foreground" Value="#EBF6F5"/>
  62. </Trigger>
  63. <Trigger Property="IsPressed" Value="True">
  64. <Setter Property="Background" Value="{DynamicResource PrimaryHomingTwoColor}"/>
  65. <Setter Property="Foreground" Value="White" />
  66. </Trigger>
  67. </Style.Triggers>
  68. </Style>
  69. <!-- Фильтрация -->
  70. <Style x:Key="ComboboxButtonStyle" TargetType="{x:Type ToggleButton}">
  71. <Setter Property="Template">
  72. <Setter.Value>
  73. <ControlTemplate TargetType="{x:Type ToggleButton}">
  74. <Border Background="White" x:Name="border" CornerRadius="0,5,5,0" BorderThickness="0,2,2,2" BorderBrush="{DynamicResource PrimaryHomingColor}">
  75. <ContentPresenter />
  76. </Border>
  77. </ControlTemplate>
  78. </Setter.Value>
  79. </Setter>
  80. </Style>
  81. <Style x:Key="ComboboxTextBoxStyle" TargetType="{x:Type TextBox}">
  82. <Setter Property="Template">
  83. <Setter.Value>
  84. <ControlTemplate TargetType="{x:Type TextBox}">
  85. <Grid>
  86. <Border CornerRadius="5,0,0,5" BorderThickness="2,2,0,2" Background="{TemplateBinding Background}" BorderBrush="{DynamicResource PrimaryHomingColor}">
  87. <ScrollViewer x:Name="PART_ContentHost"/>
  88. </Border>
  89. </Grid>
  90. </ControlTemplate>
  91. </Setter.Value>
  92. </Setter>
  93. </Style>
  94. <Style TargetType="{x:Type ComboBox}">
  95. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  96. <Setter Property="VerticalContentAlignment" Value="Center"/>
  97. <Setter Property="Foreground" Value="{DynamicResource PrimaryTextColor}"/>
  98. <Setter Property="Template">
  99. <Setter.Value>
  100. <ControlTemplate TargetType="{x:Type ComboBox}">
  101. <Grid>
  102. <Grid.ColumnDefinitions>
  103. <ColumnDefinition/>
  104. <ColumnDefinition MaxWidth="18"/>
  105. </Grid.ColumnDefinitions>
  106. <TextBox Name="PART_EditableTextBox" Style="{StaticResource ComboboxTextBoxStyle}" Padding="5,0,0,0" Height="{TemplateBinding Height}"/>
  107. <ToggleButton Grid.Column="1" Margin="0" Height="{TemplateBinding Height}" Style="{StaticResource ComboboxButtonStyle}" Focusable="False"
  108. IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press">
  109. <Path Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 4 4 L 8 0 Z" Fill="{DynamicResource PrimaryHomingColor}" />
  110. </ToggleButton>
  111. <ContentPresenter Name="ContentSite" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
  112. ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"/>
  113. <Popup Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Slide">
  114. <Grid Name="DropDown" SnapsToDevicePixels="True" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
  115. <Border x:Name="DropDownBorder" BorderThickness="2" CornerRadius="5"
  116. BorderBrush="{DynamicResource PrimaryBackgroundColor}" Background="{DynamicResource SecundaryBackgroundColor}"/>
  117. <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
  118. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
  119. </ScrollViewer>
  120. </Grid>
  121. </Popup>
  122. </Grid>
  123. </ControlTemplate>
  124. </Setter.Value>
  125. </Setter>
  126. </Style>
  127. <!-- text box -->
  128. <Style TargetType="{x:Type TextBox}">
  129. <Setter Property="Foreground" Value="{DynamicResource PrimaryTextColor}"/>
  130. <Setter Property="Template">
  131. <Setter.Value>
  132. <ControlTemplate TargetType="{x:Type TextBox}">
  133. <Border Background="{TemplateBinding Background}" x:Name="Bd" BorderBrush="{DynamicResource PrimaryHomingColor}" BorderThickness="2" CornerRadius="5">
  134. <ScrollViewer x:Name="PART_ContentHost"/>
  135. </Border>
  136. <ControlTemplate.Triggers>
  137. <Trigger Property="IsEnabled" Value="False">
  138. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" TargetName="Bd"/>
  139. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  140. </Trigger>
  141. <Trigger Property="IsMouseOver" Value="True">
  142. <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource PrimaryTextColor}"/>
  143. <Setter TargetName="Bd" Property="BorderThickness" Value="2"/>
  144. </Trigger>
  145. <Trigger Property="IsFocused" Value="True">
  146. <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource PrimaryHomingTwoColor}"/>
  147. <Setter TargetName="Bd" Property="BorderThickness" Value="2"/>
  148. </Trigger>
  149. </ControlTemplate.Triggers>
  150. </ControlTemplate>
  151. </Setter.Value>
  152. </Setter>
  153. </Style>
  154. <!-- text block -->
  155. <Style TargetType="TextBlock">
  156. <Setter Property="Foreground" Value="{DynamicResource PrimaryTextColor}"/>
  157. <Setter Property="FontWeight" Value="Bold"/>
  158. <Setter Property="HorizontalAlignment" Value="Left"/>
  159. </Style>
  160. </ResourceDictionary>