Button.xaml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
  7. xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
  8. mc:Ignorable="d">
  9. <Style x:Key="ButtonFocusVisual">
  10. <Setter Property="Control.Template">
  11. <Setter.Value>
  12. <ControlTemplate>
  13. <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
  14. </ControlTemplate>
  15. </Setter.Value>
  16. </Setter>
  17. </Style>
  18. <Style x:Key="Login_Btn" TargetType="{x:Type Button}">
  19. <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  20. <Setter Property="Background" Value="{DynamicResource Color_BG_Button}"/>
  21. <Setter Property="BorderBrush" Value="{DynamicResource Color_BD_Button}"/>
  22. <Setter Property="BorderThickness" Value="1"/>
  23. <Setter Property="FontFamily" Value="Arial"/>
  24. <Setter Property="FontSize" Value="17"/>
  25. <Setter Property="FontWeight" Value="Bold"/>
  26. <Setter Property="Foreground" Value="{DynamicResource Color_FG_Button}"/>
  27. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  28. <Setter Property="VerticalContentAlignment" Value="Center"/>
  29. <Setter Property="Padding" Value="1"/>
  30. <Setter Property="Template">
  31. <Setter.Value>
  32. <ControlTemplate TargetType="{x:Type Button}">
  33. <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
  34. <Grid>
  35. <Border BorderThickness="1" BorderBrush="{DynamicResource Color_BD_Button_InnerGrow}">
  36. <Border.Effect>
  37. <BlurEffect/>
  38. </Border.Effect>
  39. </Border>
  40. <Border x:Name="Highlight" BorderThickness="1" Background="{DynamicResource Color_BG_Button_Highlight}" Opacity="0">
  41. <Border.Effect>
  42. <BlurEffect/>
  43. </Border.Effect>
  44. </Border>
  45. <TextBlock Text="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center">
  46. <TextBlock.Effect>
  47. <DropShadowEffect BlurRadius="3" ShadowDepth="2" Color="#FF008A40"/>
  48. </TextBlock.Effect>
  49. </TextBlock>
  50. </Grid>
  51. </Border>
  52. <ControlTemplate.Triggers>
  53. <Trigger Property="IsMouseOver" Value="true">
  54. <Setter Property="Opacity" TargetName="Highlight" Value="0.5"/>
  55. </Trigger>
  56. <Trigger Property="IsPressed" Value="True">
  57. <Setter Property="Opacity" TargetName="Highlight" Value="0.5"/>
  58. </Trigger>
  59. <Trigger Property="IsEnabled" Value="false">
  60. <Setter Property="Foreground" Value="#ADADAD"/>
  61. </Trigger>
  62. </ControlTemplate.Triggers>
  63. </ControlTemplate>
  64. </Setter.Value>
  65. </Setter>
  66. </Style>
  67. <Style x:Key="SysBtnStyle" TargetType="{x:Type Button}">
  68. <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  69. <Setter Property="Background" Value="{DynamicResource Color_BG_LoginButton}"/>
  70. <Setter Property="BorderBrush" Value="{DynamicResource Color_BD_LoginButton}"/>
  71. <Setter Property="BorderThickness" Value="1"/>
  72. <Setter Property="FontFamily" Value="Arial"/>
  73. <Setter Property="FontWeight" Value="Bold"/>
  74. <Setter Property="FontSize" Value="14"/>
  75. <Setter Property="Foreground" Value="{DynamicResource Color_FG_Button_Window}"/>
  76. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  77. <Setter Property="VerticalContentAlignment" Value="Center"/>
  78. <Setter Property="Padding" Value="1"/>
  79. <Setter Property="Template">
  80. <Setter.Value>
  81. <ControlTemplate TargetType="{x:Type Button}">
  82. <Border x:Name="Bd" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true" BorderBrush="{DynamicResource Color_BD_WindowButton}" Cursor="Hand" Background="{DynamicResource Color_BG_WindowButton}">
  83. <Grid>
  84. <Border BorderThickness="1" BorderBrush="{DynamicResource Color_BD_WindowButton_InnerGrow}">
  85. <Border.Effect>
  86. <BlurEffect/>
  87. </Border.Effect>
  88. </Border>
  89. <Border x:Name="Highlight" BorderThickness="1" Background="{DynamicResource Color_BG_WindowButton_Highlight}" Opacity="0">
  90. <Border.Effect>
  91. <BlurEffect/>
  92. </Border.Effect>
  93. </Border>
  94. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Cursor="Hand">
  95. </ContentPresenter>
  96. </Grid>
  97. </Border>
  98. <ControlTemplate.Triggers>
  99. <Trigger Property="IsKeyboardFocused" Value="true"/>
  100. <Trigger Property="IsMouseOver" Value="true">
  101. <Setter Property="Opacity" TargetName="Highlight" Value="1"/>
  102. </Trigger>
  103. <Trigger Property="IsEnabled" Value="false">
  104. <Setter Property="Foreground" Value="#ADADAD"/>
  105. </Trigger>
  106. </ControlTemplate.Triggers>
  107. </ControlTemplate>
  108. </Setter.Value>
  109. </Setter>
  110. </Style>
  111. <Style x:Key="SysCloseBtnStyle" TargetType="{x:Type Button}">
  112. <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  113. <Setter Property="Background" Value="{DynamicResource Color_BG_LoginButton}"/>
  114. <Setter Property="BorderBrush" Value="{DynamicResource Color_BD_LoginButton}"/>
  115. <Setter Property="BorderThickness" Value="1"/>
  116. <Setter Property="FontFamily" Value="Arial"/>
  117. <Setter Property="FontWeight" Value="Bold"/>
  118. <Setter Property="FontSize" Value="14"/>
  119. <Setter Property="Foreground" Value="{DynamicResource Color_FG_Button_Window}"/>
  120. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  121. <Setter Property="VerticalContentAlignment" Value="Center"/>
  122. <Setter Property="Padding" Value="1"/>
  123. <Setter Property="Template">
  124. <Setter.Value>
  125. <ControlTemplate TargetType="{x:Type Button}">
  126. <Border x:Name="Bd" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true" BorderBrush="{DynamicResource Color_BD_WindowButton}" Cursor="Hand" Background="{DynamicResource Color_BG_WindowButton}">
  127. <Grid>
  128. <Border BorderThickness="1" BorderBrush="{DynamicResource Color_BD_WindowButton_InnerGrow}">
  129. <Border.Effect>
  130. <BlurEffect/>
  131. </Border.Effect>
  132. </Border>
  133. <Border x:Name="Highlight" BorderThickness="1" Background="{DynamicResource Color_BG_WindowButton_Highlight}" Opacity="0">
  134. <Border.Effect>
  135. <BlurEffect/>
  136. </Border.Effect>
  137. </Border>
  138. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Cursor="Hand">
  139. </ContentPresenter>
  140. </Grid>
  141. </Border>
  142. <ControlTemplate.Triggers>
  143. <Trigger Property="IsKeyboardFocused" Value="true"/>
  144. <Trigger Property="IsMouseOver" Value="true">
  145. <Setter Property="Opacity" TargetName="Highlight" Value="1"/>
  146. </Trigger>
  147. <Trigger Property="IsEnabled" Value="false">
  148. <Setter Property="Foreground" Value="#ADADAD"/>
  149. </Trigger>
  150. </ControlTemplate.Triggers>
  151. </ControlTemplate>
  152. </Setter.Value>
  153. </Setter>
  154. </Style>
  155. <RadialGradientBrush x:Key="highLight">
  156. <GradientStop Color="#FF64D7FF" Offset="1"></GradientStop>
  157. <GradientStop Color="White" Offset="0.2"></GradientStop>
  158. </RadialGradientBrush>
  159. <SolidColorBrush x:Key="OnOffButton_Off" Color="Gray"/>
  160. <SolidColorBrush x:Key="OnOffButton_BD" Color="#FF004900"/>
  161. <RadialGradientBrush x:Key="OnOffButton_BG">
  162. <GradientStop Color="#FF003F0F" Offset="0.25"/>
  163. <GradientStop Color="#FF067421" Offset="1"/>
  164. </RadialGradientBrush>
  165. <RadialGradientBrush x:Key="OnOffButton_BG_Highlight">
  166. <GradientStop Color="#FF89FFA6" Offset="0"/>
  167. <GradientStop Color="#FF00FF3F" Offset="1"/>
  168. </RadialGradientBrush>
  169. <RadialGradientBrush x:Key="OnOffButton_BG_Unable">
  170. <GradientStop Color="#FF939393" Offset="0"/>
  171. <GradientStop Color="#FFCACACA" Offset="1"/>
  172. </RadialGradientBrush>
  173. <Style x:Key="Lamp-Button" TargetType="{x:Type controls:SwitchButton}">
  174. <Setter Property="Width" Value="16"/>
  175. <Setter Property="Height" Value="16"/>
  176. <Setter Property="Template">
  177. <Setter.Value>
  178. <ControlTemplate TargetType="{x:Type controls:SwitchButton}">
  179. <Grid>
  180. <Ellipse x:Name="BG" Stroke="{DynamicResource OnOffButton_BD}" StrokeThickness="1" Fill="{DynamicResource OnOffButton_Off}"/>
  181. <Ellipse x:Name="Highlight" Margin="1" Visibility="Collapsed" Fill="{DynamicResource OnOffButton_BG_Highlight}">
  182. <Ellipse.Effect>
  183. <BlurEffect Radius="5"/>
  184. </Ellipse.Effect>
  185. </Ellipse>
  186. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True" Content=""/>
  187. </Grid>
  188. <ControlTemplate.Triggers>
  189. <Trigger Property="ON" Value="True">
  190. <Setter Property="Visibility" TargetName="Highlight" Value="Visible"/>
  191. </Trigger>
  192. <Trigger Property="ON" Value="False">
  193. <Setter Property="Visibility" TargetName="Highlight" Value="Collapsed"/>
  194. </Trigger>
  195. <Trigger Property="IsDefaulted" Value="True"/>
  196. <Trigger Property="IsEnabled" Value="False">
  197. <Setter Property="Fill" TargetName="BG" Value="{DynamicResource OnOffButton_BG_Unable}"/>
  198. </Trigger>
  199. </ControlTemplate.Triggers>
  200. </ControlTemplate>
  201. </Setter.Value>
  202. </Setter>
  203. </Style>
  204. <LinearGradientBrush x:Key="OperatioNButton_BG_Outer" EndPoint="0.238,0.239" StartPoint="0.85,0.864">
  205. <GradientStop Color="#FF3D3D3D" Offset="0"/>
  206. <GradientStop Color="White" Offset="1"/>
  207. </LinearGradientBrush>
  208. <LinearGradientBrush x:Key="OperatioNButton_BD_Outer" EndPoint="0.104,0.195" StartPoint="1.192,1.066">
  209. <GradientStop Color="#FF5C5C5C" Offset="0"/>
  210. <GradientStop Color="#FFE0E0E0" Offset="1"/>
  211. </LinearGradientBrush>
  212. <LinearGradientBrush x:Key="OperatioNButton_BD_Inner" EndPoint="1.141,1.123" StartPoint="0.155,0.138">
  213. <GradientStop Color="Black" Offset="0"/>
  214. <GradientStop Color="White" Offset="1"/>
  215. </LinearGradientBrush>
  216. <RadialGradientBrush x:Key="OperatioNButton_BG" GradientOrigin="0.234,0.241">
  217. <GradientStop Color="#FF004911" Offset="0"/>
  218. <GradientStop Color="#FF001D07" Offset="1"/>
  219. </RadialGradientBrush>
  220. <RadialGradientBrush x:Key="OperatioNButton_BG_Highlight" GradientOrigin="0.234,0.241">
  221. <GradientStop Color="#FF9EFFB6" Offset="0"/>
  222. <GradientStop Color="#FF00D633" Offset="1"/>
  223. </RadialGradientBrush>
  224. <LinearGradientBrush x:Key="OperatioNButton_BG_Outer_Unable" EndPoint="0.104,0.195" StartPoint="1.192,1.066">
  225. <GradientStop Color="Black" Offset="0"/>
  226. <GradientStop Color="#FFD0D0D0" Offset="1"/>
  227. </LinearGradientBrush>
  228. <SolidColorBrush x:Key="OperatioNButton_BD_Outer_Unable" Color="#FF939393"/>
  229. <LinearGradientBrush x:Key="OperatioNButton_BD_Inner_Unable" EndPoint="1.141,1.123" StartPoint="0.155,0.138">
  230. <GradientStop Color="Black" Offset="0"/>
  231. <GradientStop Color="#FFD0D0D0" Offset="1"/>
  232. </LinearGradientBrush>
  233. <RadialGradientBrush x:Key="OperatioNButton_BG_Unable" GradientOrigin="0.234,0.241">
  234. <GradientStop Color="#FF858585" Offset="0"/>
  235. <GradientStop Color="#FF4E4E4E" Offset="1"/>
  236. </RadialGradientBrush>
  237. <Style x:Key="OperationButton" TargetType="{x:Type controls:SwitchButton}">
  238. <Setter Property="Width" Value="18"/>
  239. <Setter Property="Height" Value="18"/>
  240. <Setter Property="Template">
  241. <Setter.Value>
  242. <ControlTemplate TargetType="{x:Type controls:SwitchButton}">
  243. <Grid>
  244. <Ellipse x:Name="BG" Fill="{DynamicResource OperatioNButton_BG_Outer}" Stroke="{DynamicResource OperatioNButton_BD_Outer}" StrokeThickness="0.5"/>
  245. <Ellipse x:Name="Inner_BG" Margin="2" Fill="{DynamicResource OperatioNButton_BD_Inner}"/>
  246. <Ellipse x:Name="Close" Margin="3" Cursor="Hand" Fill="{DynamicResource OperatioNButton_BG}" />
  247. <Ellipse x:Name="Open" Margin="3" Cursor="Hand" Visibility="Collapsed" Fill="{DynamicResource OperatioNButton_BG_Highlight}" >
  248. <Ellipse.Effect>
  249. <DropShadowEffect ShadowDepth="0" Color="White" BlurRadius="3"/>
  250. </Ellipse.Effect>
  251. </Ellipse>
  252. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True" Content=""/>
  253. </Grid>
  254. <ControlTemplate.Triggers>
  255. <Trigger Property="ON" Value="True">
  256. <Setter Property="Visibility" TargetName="Open" Value="Visible"/>
  257. </Trigger>
  258. <Trigger Property="ON" Value="False">
  259. <Setter Property="Visibility" TargetName="Open" Value="Collapsed"/>
  260. </Trigger>
  261. <Trigger Property="IsDefaulted" Value="True"/>
  262. <Trigger Property="IsEnabled" Value="False">
  263. <Setter Property="Fill" TargetName="BG" Value="{DynamicResource OperatioNButton_BG_Outer_Unable}"/>
  264. <Setter Property="Stroke" TargetName="BG" Value="{DynamicResource OperatioNButton_BD_Outer_Unable}"/>
  265. <Setter Property="Fill" TargetName="Inner_BG" Value="{DynamicResource OperatioNButton_BD_Inner_Unable}"/>
  266. <Setter Property="Fill" TargetName="Close" Value="{DynamicResource OperatioNButton_BG_Unable}"/>
  267. </Trigger>
  268. </ControlTemplate.Triggers>
  269. </ControlTemplate>
  270. </Setter.Value>
  271. </Setter>
  272. </Style>
  273. <!-- Normal Button style -->
  274. <SolidColorBrush x:Key="Button_BG" Color="#FF6398CC"/>
  275. <SolidColorBrush x:Key="Button_BD" Color="#FFC6D8EC"/>
  276. <SolidColorBrush x:Key="Button_BD_Shadow" Color="#FF284775"/>
  277. <SolidColorBrush x:Key="Button_BG_MouseOver" Color="#FF4FCBFF"/>
  278. <SolidColorBrush x:Key="Button_BG_Press" Color="#FF5A89D4"/>
  279. <SolidColorBrush x:Key="Button_BG_Unable" Color="#FFD2D2D2"/>
  280. <SolidColorBrush x:Key="Button_BD_Unable" Color="#FFF3F3F3"/>
  281. <SolidColorBrush x:Key="Button_BD_Shadow_Unable" Color="#FF9D9D9D"/>
  282. <Style TargetType="{x:Type Button}">
  283. <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  284. <Setter Property="Background" Value="{StaticResource Button_BG}"/>
  285. <Setter Property="BorderBrush" Value="{StaticResource Button_BD}"/>
  286. <Setter Property="BorderThickness" Value="1,1,0,0"/>
  287. <Setter Property="FontFamily" Value="Arial"/>
  288. <Setter Property="FontSize" Value="14"/>
  289. <Setter Property="Foreground" Value="{DynamicResource FG_White}"/>
  290. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  291. <Setter Property="VerticalContentAlignment" Value="Center"/>
  292. <Setter Property="Padding" Value="6,3"/>
  293. <Setter Property="MinWidth" Value="40"/>
  294. <Setter Property="MinHeight" Value="20"/>
  295. <Setter Property="SnapsToDevicePixels" Value="True"/>
  296. <Setter Property="Border.CornerRadius" Value="4"/>
  297. <Setter Property="Template">
  298. <Setter.Value>
  299. <ControlTemplate TargetType="{x:Type Button}">
  300. <Border x:Name="BG" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" CornerRadius="{TemplateBinding Border.CornerRadius}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Cursor="Hand">
  301. <Border x:Name="Inner_BD" BorderBrush="{StaticResource Button_BD_Shadow}" BorderThickness="0,0,1,1" CornerRadius="3" Padding="5,1">
  302. <ContentPresenter x:Name="contentpresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Cursor="Hand">
  303. </ContentPresenter>
  304. </Border>
  305. </Border>
  306. <ControlTemplate.Triggers>
  307. <Trigger Property="IsMouseOver" Value="True">
  308. <Setter TargetName="BG" Property="Background" Value="{StaticResource Button_BG_MouseOver}"/>
  309. </Trigger>
  310. <Trigger Property="IsPressed" Value="True">
  311. <Setter TargetName="BG" Property="Background" Value="{StaticResource Button_BG_Press}"/>
  312. <Setter TargetName="BG" Property="Margin" Value="1"/>
  313. <Setter Property="FontSize" Value="13"/>
  314. </Trigger>
  315. <Trigger Property="IsEnabled" Value="False">
  316. <Setter TargetName="BG" Property="Background" Value="{StaticResource Button_BG_Unable}"/>
  317. <Setter TargetName="BG" Property="BorderBrush" Value="{StaticResource Button_BD_Unable}"/>
  318. <Setter TargetName="Inner_BD" Property="BorderBrush" Value="{StaticResource Button_BD_Shadow_Unable}"/>
  319. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  320. </Trigger>
  321. </ControlTemplate.Triggers>
  322. </ControlTemplate>
  323. </Setter.Value>
  324. </Setter>
  325. </Style>
  326. <Style x:Key="Color_Button" TargetType="{x:Type Button}">
  327. <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  328. <Setter Property="Background" Value="Black"/>
  329. <Setter Property="BorderBrush" Value="{StaticResource Button_BD}"/>
  330. <Setter Property="BorderThickness" Value="0"/>
  331. <Setter Property="FontFamily" Value="Arial"/>
  332. <Setter Property="FontSize" Value="12"/>
  333. <Setter Property="Foreground" Value="{DynamicResource FG_Black}"/>
  334. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  335. <Setter Property="VerticalContentAlignment" Value="Center"/>
  336. <Setter Property="Padding" Value="1"/>
  337. <Setter Property="SnapsToDevicePixels" Value="True"/>
  338. <Setter Property="Border.CornerRadius" Value="0"/>
  339. <Setter Property="Template">
  340. <Setter.Value>
  341. <ControlTemplate TargetType="{x:Type Button}">
  342. <Grid>
  343. <Rectangle Fill="Gray"/>
  344. <Border x:Name="BG" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" CornerRadius="{TemplateBinding Border.CornerRadius}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Cursor="Hand">
  345. <Grid>
  346. <Border x:Name="Inner_BG" CornerRadius="{TemplateBinding Border.CornerRadius}" Background="White" Opacity="0"/>
  347. <ContentPresenter x:Name="contentpresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Cursor="Hand">
  348. <ContentPresenter.Effect>
  349. <DropShadowEffect BlurRadius="0" ShadowDepth="1" Color="White" Direction="135"/>
  350. </ContentPresenter.Effect>
  351. </ContentPresenter>
  352. </Grid>
  353. </Border>
  354. </Grid>
  355. <ControlTemplate.Triggers>
  356. <Trigger Property="IsMouseOver" Value="True">
  357. <Setter TargetName="Inner_BG" Property="Opacity" Value="0.4"/>
  358. </Trigger>
  359. <Trigger Property="IsPressed" Value="True">
  360. <Setter TargetName="Inner_BG" Property="Opacity" Value="0.4"/>
  361. </Trigger>
  362. <Trigger Property="IsEnabled" Value="False">
  363. <Setter TargetName="BG" Property="Background" Value="{StaticResource Button_BG_Unable}"/>
  364. <Setter TargetName="BG" Property="BorderBrush" Value="{StaticResource Button_BD_Unable}"/>
  365. <Setter TargetName="Inner_BG" Property="Background" Value="{StaticResource Button_InnerBG_Unable}"/>
  366. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  367. <Setter Property="Effect" TargetName="contentpresenter">
  368. <Setter.Value>
  369. <DropShadowEffect BlurRadius="0" Color="White" Direction="135" Opacity="0" ShadowDepth="1"/>
  370. </Setter.Value>
  371. </Setter>
  372. </Trigger>
  373. </ControlTemplate.Triggers>
  374. </ControlTemplate>
  375. </Setter.Value>
  376. </Setter>
  377. </Style>
  378. <!-- Top Button -->
  379. <SolidColorBrush x:Key="TopButton_BD" Color="#FFB2BACF"/>
  380. <SolidColorBrush x:Key="TopButton_BG" Color="#FF2F457E"/>
  381. <LinearGradientBrush x:Key="TopButton_InnerBG" EndPoint="0.5,1" StartPoint="0.5,0">
  382. <GradientStop Color="#00D1DEED" Offset="0"/>
  383. <GradientStop Color="#008EABD0" Offset="1"/>
  384. </LinearGradientBrush>
  385. <SolidColorBrush x:Key="TopButton_BG_MouseOver" Color="#FF4F71B6"/>
  386. <LinearGradientBrush x:Key="TopButton_InnerBG_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
  387. <GradientStop Color="#00D1E7ED" Offset="0"/>
  388. <GradientStop Color="#0043BFE9" Offset="1"/>
  389. </LinearGradientBrush>
  390. <SolidColorBrush x:Key="TopButton_BD_Highlight" Color="White"/>
  391. <SolidColorBrush x:Key="TopButton_BG_Press" Color="#FF4F71B6"/>
  392. <LinearGradientBrush x:Key="TopButton_InnerBG_Press" EndPoint="0.5,1" StartPoint="0.5,0">
  393. <GradientStop Color="#00D8E7F5" Offset="0"/>
  394. <GradientStop Color="#00A3C7E9" Offset="1"/>
  395. </LinearGradientBrush>
  396. <SolidColorBrush x:Key="FG_Button_Unable" Color="#FF757575"/>
  397. <SolidColorBrush x:Key="TopButton_BG_Unable" Color="#FFD4D4D4"/>
  398. <SolidColorBrush x:Key="TopButton_BD_Unable" Color="WhiteSmoke"/>
  399. <SolidColorBrush x:Key="TopButton_InnerBG_Unable" Color="#FFA7A8AA"/>
  400. <SolidColorBrush x:Key="TopButton_Shadow" Color="#FF162858"/>
  401. <SolidColorBrush x:Key="TopButton_BG_Highlight" Color="#FF4F71B6"/>
  402. <Style x:Key="TopButton" TargetType="{x:Type Button}">
  403. <Setter Property="Height" Value="38"/>
  404. <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  405. <Setter Property="Background" Value="{StaticResource TopButton_BG}"/>
  406. <Setter Property="BorderBrush" Value="{StaticResource TopButton_BD}"/>
  407. <Setter Property="BorderThickness" Value="1,1,0,0"/>
  408. <Setter Property="FontFamily" Value="Arial"/>
  409. <Setter Property="FontSize" Value="16"/>
  410. <Setter Property="FontWeight" Value="Bold"/>
  411. <Setter Property="Foreground" Value="{DynamicResource FG_White}"/>
  412. <Setter Property="Border.CornerRadius" Value="5"/>
  413. <Setter Property="SnapsToDevicePixels" Value="True"/>
  414. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  415. <Setter Property="VerticalContentAlignment" Value="Center"/>
  416. <Setter Property="Padding" Value="1"/>
  417. <Setter Property="Template">
  418. <Setter.Value>
  419. <ControlTemplate TargetType="{x:Type Button}">
  420. <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding Border.CornerRadius}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Cursor="Hand">
  421. <Border x:Name="border_shadow" BorderBrush="{DynamicResource TextBox_Top_Shadow}" BorderThickness="0,0,1,1" CornerRadius="5">
  422. <ContentPresenter x:Name="contentpresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Cursor="Hand">
  423. </ContentPresenter>
  424. </Border>
  425. </Border>
  426. <ControlTemplate.Triggers>
  427. <Trigger Property="IsMouseOver" Value="true">
  428. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TopButton_BD_Highlight}"/>
  429. <Setter Property="Background" TargetName="border" Value="{StaticResource TopButton_BG_Highlight}"/>
  430. </Trigger>
  431. <Trigger Property="IsPressed" Value="True">
  432. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TopButton_BD_Highlight}"/>
  433. <Setter Property="Background" TargetName="border" Value="{StaticResource TopButton_BG_Highlight}"/>
  434. <Setter Property="FontSize" Value="15"/>
  435. </Trigger>
  436. <Trigger Property="IsEnabled" Value="false">
  437. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TopButton_BD_Unable}"/>
  438. <Setter Property="Background" TargetName="border" Value="{StaticResource TopButton_BG_Unable}"/>
  439. <Setter Property="BorderBrush" TargetName="border_shadow" Value="{StaticResource TopButton_InnerBG_Unable}"/>
  440. <Setter Property="Foreground" Value="{StaticResource FG_Button_Unable}"/>
  441. </Trigger>
  442. </ControlTemplate.Triggers>
  443. </ControlTemplate>
  444. </Setter.Value>
  445. </Setter>
  446. </Style>
  447. <!-- Logout Button -->
  448. <SolidColorBrush x:Key="TopMenuButton_BD" Color="#FFBBD8E5"/>
  449. <LinearGradientBrush x:Key="TopMenuButton_BG" EndPoint="0.5,1" StartPoint="0.5,0">
  450. <GradientStop Color="#FF5E5E5E" Offset="0"/>
  451. <GradientStop Color="#FF474B4E" Offset="1"/>
  452. <GradientStop Color="#FF242424" Offset="0.5"/>
  453. <GradientStop Color="#FF1F1F1F" Offset="0.75"/>
  454. </LinearGradientBrush>
  455. <LinearGradientBrush x:Key="TopMenuButton_BG_Highlight" EndPoint="0.5,1" StartPoint="0.5,0">
  456. <GradientStop Color="#FF0076B2" Offset="0"/>
  457. <GradientStop Color="#FF0076B2" Offset="1"/>
  458. <GradientStop Color="#FF00466A" Offset="0.5"/>
  459. <GradientStop Color="#FF00466A" Offset="0.75"/>
  460. </LinearGradientBrush>
  461. <SolidColorBrush x:Key="TopMenuButton_BD_Highlight" Color="#FFF0FAFF"/>
  462. <LinearGradientBrush x:Key="TopMenuButton_BG_Unable" EndPoint="0.5,1" StartPoint="0.5,0">
  463. <GradientStop Color="#FFAFAFAF" Offset="0"/>
  464. <GradientStop Color="#FFAFAFAF" Offset="1"/>
  465. <GradientStop Color="#FF6C6C6C" Offset="0.5"/>
  466. <GradientStop Color="#FF7A7A7A" Offset="0.25"/>
  467. <GradientStop Color="#FF7A7A7A" Offset="0.75"/>
  468. </LinearGradientBrush>
  469. <SolidColorBrush x:Key="TopMenuButton_BD_Unable" Color="#FFB6B6B6"/>
  470. <LinearGradientBrush x:Key="LogoutBtn_InnerBG_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
  471. <GradientStop Color="#FF75D5ED" Offset="0"/>
  472. <GradientStop Color="#FF03B5E2" Offset="1"/>
  473. <GradientStop Color="#FF45C8E9" Offset="0.49"/>
  474. <GradientStop Color="#FF00A0C8" Offset="0.5"/>
  475. </LinearGradientBrush>
  476. <SolidColorBrush x:Key="LogoutBtn_BG_MouseOver" Color="#FF005C8D"/>
  477. <SolidColorBrush x:Key="LogoutBtn_BD" Color="#FF9FBADE"/>
  478. <LinearGradientBrush x:Key="LogoutBtn_InnerBG_Press" EndPoint="0.5,1" StartPoint="0.5,0">
  479. <GradientStop Color="#FFBCE5EF" Offset="0"/>
  480. <GradientStop Color="#FF02C5F5" Offset="1"/>
  481. <GradientStop Color="#FF73D5ED" Offset="0.49"/>
  482. <GradientStop Color="#FF02C5F5" Offset="0.5"/>
  483. </LinearGradientBrush>
  484. <SolidColorBrush x:Key="LogoutBtn_BG_Press" Color="#FF02A6D0"/>
  485. <LinearGradientBrush x:Key="LogoutBtn_InnerBG" EndPoint="0.5,1" StartPoint="0.5,0">
  486. <GradientStop Color="#FF7EA5CD" Offset="0"/>
  487. <GradientStop Color="#FF305F9D" Offset="1"/>
  488. <GradientStop Color="#FF4D83B8" Offset="0.495"/>
  489. <GradientStop Color="#FF27549D" Offset="0.5"/>
  490. </LinearGradientBrush>
  491. <SolidColorBrush x:Key="LogoutBtn_BG" Color="#FF2C4566"/>
  492. <SolidColorBrush x:Key="LogoutBtn_Shadow" Color="#FF0C1F39"/>
  493. <Style x:Key="Logout_Button" TargetType="{x:Type Button}" BasedOn="{StaticResource TopButton}"/>
  494. <!-- Login Button -->
  495. <SolidColorBrush x:Key="Login_Btn_BD_Highlight" Color="#FF84ADEB"/>
  496. <SolidColorBrush x:Key="Login_Btn_BD_Shadow" Color="#FF1E385B"/>
  497. <SolidColorBrush x:Key="Login_Btn_BG" Color="#FF4781D3"/>
  498. <SolidColorBrush x:Key="Login_Btn_BD_MouseOver_Highlight" Color="#FFA1E7FF"/>
  499. <SolidColorBrush x:Key="Login_Btn_BG_MouseOver" Color="DeepSkyBlue"/>
  500. <SolidColorBrush x:Key="Login_Btn_BD_MouseOver_Shadow" Color="#FF005B7A"/>
  501. <SolidColorBrush x:Key="Login_Btn_BG_Press" Color="#FF85E0FF"/>
  502. <Style x:Key="Login_Button" TargetType="{x:Type Button}">
  503. <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  504. <Setter Property="BorderThickness" Value="1"/>
  505. <Setter Property="FontFamily" Value="Arial"/>
  506. <Setter Property="FontSize" Value="24"/>
  507. <Setter Property="FontWeight" Value="Bold"/>
  508. <Setter Property="Foreground" Value="{DynamicResource FG_White}"/>
  509. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  510. <Setter Property="VerticalContentAlignment" Value="Center"/>
  511. <Setter Property="Padding" Value="1"/>
  512. <Setter Property="SnapsToDevicePixels" Value="True"/>
  513. <Setter Property="Border.CornerRadius" Value="5"/>
  514. <Setter Property="Template">
  515. <Setter.Value>
  516. <ControlTemplate TargetType="{x:Type Button}">
  517. <Border x:Name="BG" BorderThickness="2,2,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" CornerRadius="{TemplateBinding Border.CornerRadius}" BorderBrush="{StaticResource Login_Btn_BD_Highlight}" Background="{StaticResource Login_Btn_BG}" Cursor="Hand">
  518. <Border x:Name="Inner_BD" BorderThickness="0,0,2,2" CornerRadius="{TemplateBinding Border.CornerRadius}" BorderBrush="{StaticResource Login_Btn_BD_Shadow}">
  519. <ContentPresenter x:Name="contentpresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Cursor="Hand">
  520. <ContentPresenter.Effect>
  521. <DropShadowEffect BlurRadius="0" ShadowDepth="1.5" Direction="315"/>
  522. </ContentPresenter.Effect>
  523. </ContentPresenter>
  524. </Border>
  525. </Border>
  526. <ControlTemplate.Triggers>
  527. <Trigger Property="IsMouseOver" Value="True">
  528. <Setter TargetName="BG" Property="Background" Value="{StaticResource Login_Btn_BG_MouseOver}"/>
  529. <Setter TargetName="BG" Property="BorderBrush" Value="{StaticResource Login_Btn_BD_MouseOver_Highlight}"/>
  530. <Setter TargetName="Inner_BD" Property="BorderBrush" Value="{StaticResource Login_Btn_BD_MouseOver_Shadow}"/>
  531. </Trigger>
  532. <Trigger Property="IsPressed" Value="True">
  533. <Setter TargetName="BG" Property="Background" Value="{StaticResource Login_Btn_BG_Press}"/>
  534. </Trigger>
  535. <Trigger Property="IsEnabled" Value="False">
  536. <Setter TargetName="BG" Property="Background" Value="{StaticResource Button_BG_Unable}"/>
  537. <Setter TargetName="BG" Property="BorderBrush" Value="{StaticResource Button_BD_Unable}"/>
  538. <Setter TargetName="Inner_BD" Property="BorderBrush" Value="{StaticResource Button_BD_Shadow_Unable}"/>
  539. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  540. <Setter Property="Effect" TargetName="contentpresenter">
  541. <Setter.Value>
  542. <DropShadowEffect BlurRadius="0" Color="White" Direction="315" Opacity="0" ShadowDepth="1"/>
  543. </Setter.Value>
  544. </Setter>
  545. </Trigger>
  546. </ControlTemplate.Triggers>
  547. </ControlTemplate>
  548. </Setter.Value>
  549. </Setter>
  550. </Style>
  551. </ResourceDictionary>