Style.xaml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="MyTests.Style">
  4. <SolidColorBrush x:Key="TextColor"
  5. Color="White">
  6. </SolidColorBrush>
  7. <SolidColorBrush x:Key="color1"
  8. Color="#32353B">
  9. </SolidColorBrush>
  10. <SolidColorBrush x:Key="color2"
  11. Color="#2F3136">
  12. </SolidColorBrush>
  13. <SolidColorBrush x:Key="color3"
  14. Color="#FF44464D">
  15. </SolidColorBrush>
  16. <Style TargetType="Label">
  17. <Setter Property="Foreground" Value="White"/>
  18. <Setter Property="VerticalContentAlignment" Value="Center"/>
  19. </Style>
  20. <Style TargetType="Run">
  21. <Setter Property="Foreground" Value="White"/>
  22. </Style>
  23. <Style TargetType="TextBox">
  24. <Setter Property="Foreground" Value="White"/>
  25. <Setter Property="BorderBrush" Value="Black"/>
  26. <Setter Property="Background" Value="#33363C"/>
  27. <Setter Property="VerticalContentAlignment" Value="Center"/>
  28. </Style>
  29. <Style TargetType="PasswordBox">
  30. <Setter Property="Foreground" Value="White"/>
  31. <Setter Property="BorderBrush" Value="Black"/>
  32. <Setter Property="Background" Value="#33363C"/>
  33. <Setter Property="VerticalContentAlignment" Value="Center"/>
  34. </Style>
  35. <Style TargetType="TextBlock">
  36. <Setter Property="Foreground" Value="White"/>
  37. <Setter Property="Background" Value="{x:Null}"/>
  38. </Style>
  39. <Style TargetType="ComboBox">
  40. <Setter Property="Foreground" Value="White"/>
  41. <Setter Property="BorderBrush" Value="Black"/>
  42. <Setter Property="Background" Value="#33363C"/>
  43. </Style>
  44. <Style TargetType="ComboBoxItem">
  45. <Setter Property="Background" Value="#33363C"/>
  46. <Setter Property="BorderBrush" Value="Black"/>
  47. </Style>
  48. <Style TargetType="Button">
  49. <Setter Property="Template">
  50. <Setter.Value>
  51. <ControlTemplate TargetType="Button">
  52. <Border Name="Border"
  53. CornerRadius="15"
  54. Background="#33363C"
  55. BorderBrush="Black"
  56. BorderThickness="1.5"
  57. MouseEnter="MouseEnter"
  58. MouseLeave="MouseLeave">
  59. <ContentPresenter HorizontalAlignment="Center"
  60. VerticalAlignment="Center"/>
  61. </Border>
  62. </ControlTemplate>
  63. </Setter.Value>
  64. </Setter>
  65. <Setter Property="Foreground"
  66. Value="White"/>
  67. </Style>
  68. <Style x:Key="ScrollThumbs" TargetType="{x:Type Thumb}">
  69. <Setter Property="Template">
  70. <Setter.Value>
  71. <ControlTemplate>
  72. <Grid x:Name="Grid">
  73. <Border x:Name="Rectangle1"
  74. CornerRadius="10 0 0 10"
  75. HorizontalAlignment="Stretch"
  76. VerticalAlignment="Stretch"
  77. Width="Auto"
  78. Height="Auto"
  79. Background="{TemplateBinding Background}"/>
  80. </Grid>
  81. </ControlTemplate>
  82. </Setter.Value>
  83. </Setter>
  84. </Style>
  85. <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
  86. <Setter Property="Foreground" Value="#FF2D2D30"/>
  87. <Setter Property="Template">
  88. <Setter.Value>
  89. <ControlTemplate TargetType="{x:Type ScrollBar}">
  90. <Grid x:Name="GridRoot" Width="12" Background="{x:Null}">
  91. <Track x:Name="PART_Track" Grid.Row="0" IsDirectionReversed="true" Focusable="False">
  92. <Track.Thumb>
  93. <Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}"
  94. Style="{DynamicResource ScrollThumbs}"/>
  95. </Track.Thumb>
  96. <Track.IncreaseRepeatButton>
  97. <RepeatButton x:Name="PageUp" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="False"/>
  98. </Track.IncreaseRepeatButton>
  99. <Track.DecreaseRepeatButton>
  100. <RepeatButton x:Name="PageDown" Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="False"/>
  101. </Track.DecreaseRepeatButton>
  102. </Track>
  103. </Grid>
  104. <ControlTemplate.Triggers>
  105. <Trigger SourceName="Thumb" Property="IsMouseOver" Value="true">
  106. <Setter Value="{DynamicResource ButtonSelectBrush}"
  107. TargetName="Thumb" Property="Background"/>
  108. </Trigger>
  109. <Trigger SourceName="Thumb" Property="IsDragging" Value="true">
  110. <Setter Value="{DynamicResource DarkBrush}" TargetName="Thumb" Property="Background"/>
  111. </Trigger>
  112. <Trigger Property="IsEnabled" Value="false">
  113. <Setter TargetName="Thumb" Property="Visibility" Value="Collapsed"/>
  114. </Trigger>
  115. <Trigger Property="Orientation" Value="Horizontal">
  116. <Setter TargetName="GridRoot" Property="LayoutTransform">
  117. <Setter.Value>
  118. <RotateTransform Angle="-90"/>
  119. </Setter.Value>
  120. </Setter>
  121. <Setter TargetName="PART_Track" Property="LayoutTransform">
  122. <Setter.Value>
  123. <RotateTransform Angle="-90"/>
  124. </Setter.Value>
  125. </Setter>
  126. <Setter Property="Width" Value="Auto"/>
  127. <Setter Property="Height" Value="12"/>
  128. <Setter TargetName="Thumb" Property="Tag" Value="Horizontal"/>
  129. <Setter TargetName="PageDown" Property="Command" Value="ScrollBar.PageLeftCommand"/>
  130. <Setter TargetName="PageUp" Property="Command" Value="ScrollBar.PageRightCommand"/>
  131. </Trigger>
  132. </ControlTemplate.Triggers>
  133. </ControlTemplate>
  134. </Setter.Value>
  135. </Setter>
  136. </Style>
  137. </ResourceDictionary>