ButtonStyle.xaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <!--按钮通用样式(原MiddleButton)-->
  4. <LinearGradientBrush x:Key="buttonNormal" StartPoint="0.5,0" EndPoint="0.5,1">
  5. <GradientStop Color="#0086cd" Offset="0" />
  6. <GradientStop Color="#389cd0" Offset="1" />
  7. </LinearGradientBrush>
  8. <SolidColorBrush x:Key="buttonForground" Color="White"></SolidColorBrush>
  9. <SolidColorBrush x:Key="buttonBorder" Color="#62b8e5"></SolidColorBrush>
  10. <LinearGradientBrush x:Key="buttonHover" StartPoint="0.5,0" EndPoint="0.5,1">
  11. <GradientStop Color="#668fa5" Offset="0" />
  12. <GradientStop Color="#3c6982" Offset="1" />
  13. </LinearGradientBrush>
  14. <SolidColorBrush x:Key="buttonPressed" Color="#ffffff"></SolidColorBrush>
  15. <Style TargetType="Button">
  16. <Setter Property="Background" Value="{StaticResource buttonNormal}"></Setter>
  17. <Setter Property="Foreground" Value="{StaticResource buttonForground}"></Setter>
  18. <Setter Property="BorderBrush" Value="{StaticResource buttonBorder}"></Setter>
  19. <Setter Property="Cursor" Value="Hand"/>
  20. <Setter Property="Margin" Value="5"/>
  21. <Setter Property="FontFamily" Value="Arial,SimSun" />
  22. <Setter Property="FontSize" Value="17"/>
  23. <Setter Property="Height" Value="40"></Setter>
  24. <Setter Property="Width" Value="100"></Setter>
  25. <Setter Property="VerticalAlignment" Value="Top"></Setter>
  26. <Setter Property="Template">
  27. <Setter.Value>
  28. <ControlTemplate TargetType="{x:Type Button}">
  29. <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"
  30. SnapsToDevicePixels="true" CornerRadius="3,3,3,3">
  31. <ContentPresenter x:Name="contentPresenter"
  32. Focusable="False"
  33. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  34. Margin="{TemplateBinding Padding}"
  35. RecognizesAccessKey="True"
  36. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  37. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  38. </Border>
  39. <ControlTemplate.Triggers>
  40. <Trigger Property="IsMouseOver" Value="true">
  41. <Setter Property="Background" TargetName="border" Value="{StaticResource buttonHover}"/>
  42. </Trigger>
  43. <Trigger Property="IsPressed" Value="true">
  44. <Setter Property="Background" TargetName="border" Value="{StaticResource buttonPressed}"/>
  45. </Trigger>
  46. <Trigger Property="IsEnabled" Value="false">
  47. <Setter Property="Opacity" Value="0.5" TargetName="border"/>
  48. <Setter Property="Background" TargetName="border" Value="Gray" />
  49. </Trigger>
  50. </ControlTemplate.Triggers>
  51. </ControlTemplate>
  52. </Setter.Value>
  53. </Setter>
  54. </Style>
  55. <!--<Style TargetType="Button">
  56. <Setter Property="FontWeight" Value="Bold"/>
  57. <Setter Property="Cursor" Value="Hand"/>
  58. <Setter Property="Foreground" Value="#FF181C1F" />
  59. <Setter Property="Background" Value="CadetBlue" />
  60. <Setter Property="BorderBrush" Value="Blue" />
  61. <Setter Property="Margin" Value="5"/>
  62. <Setter Property="FontFamily" Value="Arial,SimSun" />
  63. <Setter Property="FontSize" Value="15"/>
  64. <Setter Property="VerticalAlignment" Value="Top" />
  65. <Setter Property="Height" Value="40"></Setter>
  66. <Setter Property="Width" Value="100"></Setter>
  67. <Setter Property="BitmapEffect" >
  68. <Setter.Value>
  69. <BevelBitmapEffect BevelWidth="2" />
  70. </Setter.Value>
  71. </Setter>
  72. <Style.Triggers>
  73. <Trigger Property="IsMouseOver" Value="True">
  74. <Setter Property="Foreground" Value="Green" />
  75. </Trigger>
  76. --><!-- When the mouse is pressed, apply a bevel with a narrower BevelWidth to make the button appear to get pressed. --><!--
  77. <Trigger Property="IsPressed" Value="true">
  78. <Setter Property="Background" Value="#FFEEFDFC" />
  79. <Setter Property="BitmapEffect" >
  80. <Setter.Value>
  81. <BevelBitmapEffect BevelWidth="3" />
  82. </Setter.Value>
  83. </Setter>
  84. </Trigger>
  85. </Style.Triggers>
  86. </Style>-->
  87. <!--主窗口样式-->
  88. <!--右下角-->
  89. <Style TargetType="Button" x:Key="NavUpButton">
  90. <Setter Property="Height" Value="37"></Setter>
  91. <Setter Property="Width" Value="34"></Setter>
  92. <Setter Property="Cursor" Value="Hand"></Setter>
  93. <Setter Property="HorizontalAlignment" Value="Left"></Setter>
  94. <Setter Property="VerticalAlignment" Value="Top"></Setter>
  95. <Setter Property="Template">
  96. <Setter.Value>
  97. <ControlTemplate TargetType="ButtonBase">
  98. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  99. <ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" Margin="{TemplateBinding Control.Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" />
  100. </Border>
  101. </ControlTemplate>
  102. </Setter.Value>
  103. </Setter>
  104. <Setter Property="Background" >
  105. <Setter.Value>
  106. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/上一个.png">
  107. </ImageBrush>
  108. </Setter.Value>
  109. </Setter>
  110. <Style.Triggers>
  111. <Trigger Property="IsMouseOver" Value="True">
  112. <Setter Property="Background" >
  113. <Setter.Value>
  114. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/上一个_悬停.png">
  115. </ImageBrush>
  116. </Setter.Value>
  117. </Setter>
  118. </Trigger>
  119. <Trigger Property="IsPressed" Value="True">
  120. <Setter Property="Background">
  121. <Setter.Value>
  122. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/上一个_点击.png">
  123. </ImageBrush>
  124. </Setter.Value>
  125. </Setter>
  126. </Trigger>
  127. </Style.Triggers>
  128. </Style>
  129. <Style TargetType="Button" x:Key="NavBackButton">
  130. <Setter Property="Height" Value="37"></Setter>
  131. <Setter Property="Width" Value="34"></Setter>
  132. <Setter Property="Cursor" Value="Hand"></Setter>
  133. <Setter Property="HorizontalAlignment" Value="Right"></Setter>
  134. <Setter Property="VerticalAlignment" Value="Top"></Setter>
  135. <Setter Property="Template">
  136. <Setter.Value>
  137. <ControlTemplate TargetType="ButtonBase">
  138. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  139. <ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" Margin="{TemplateBinding Control.Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" />
  140. </Border>
  141. </ControlTemplate>
  142. </Setter.Value>
  143. </Setter>
  144. <Setter Property="Background" >
  145. <Setter.Value>
  146. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/下一个.png">
  147. </ImageBrush>
  148. </Setter.Value>
  149. </Setter>
  150. <Style.Triggers>
  151. <Trigger Property="IsMouseOver" Value="True">
  152. <Setter Property="Background" >
  153. <Setter.Value>
  154. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/下一个_悬停.png">
  155. </ImageBrush>
  156. </Setter.Value>
  157. </Setter>
  158. </Trigger>
  159. <Trigger Property="IsPressed" Value="true">
  160. <Setter Property="Background" >
  161. <Setter.Value>
  162. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/下一个_点击.png">
  163. </ImageBrush>
  164. </Setter.Value>
  165. </Setter>
  166. </Trigger>
  167. </Style.Triggers>
  168. </Style>
  169. <Style TargetType="Button" x:Key="MainButton">
  170. <Setter Property="Cursor" Value="Hand"/>
  171. <Setter Property="Foreground" Value="#FF004294" />
  172. <Setter Property="BorderBrush" Value="Blue" />
  173. <Setter Property="Margin" Value="5"/>
  174. <Setter Property="FontFamily" Value="Arial,SimSun" />
  175. <Setter Property="FontSize" Value="22"/>
  176. <Setter Property="Height" Value="45"></Setter>
  177. <Setter Property="Width" Value="160"></Setter>
  178. <Setter Property="HorizontalAlignment" Value="Right"></Setter>
  179. <Setter Property="VerticalAlignment" Value="Top"></Setter>
  180. <Setter Property="Template">
  181. <Setter.Value>
  182. <ControlTemplate TargetType="ButtonBase">
  183. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  184. <ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" Margin="{TemplateBinding Control.Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" />
  185. </Border>
  186. </ControlTemplate>
  187. </Setter.Value>
  188. </Setter>
  189. <Setter Property="Background" >
  190. <Setter.Value>
  191. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/主菜单按钮.png">
  192. </ImageBrush>
  193. </Setter.Value>
  194. </Setter>
  195. <Style.Triggers>
  196. <Trigger Property="IsMouseOver" Value="True">
  197. <Setter Property="Background" >
  198. <Setter.Value>
  199. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/主菜单按钮_悬停.png">
  200. </ImageBrush>
  201. </Setter.Value>
  202. </Setter>
  203. </Trigger>
  204. <Trigger Property="IsPressed" Value="true">
  205. <Setter Property="Background" >
  206. <Setter.Value>
  207. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/主菜单按钮_点击.png">
  208. </ImageBrush>
  209. </Setter.Value>
  210. </Setter>
  211. </Trigger>
  212. </Style.Triggers>
  213. </Style>
  214. <!--右上角-->
  215. <Style TargetType="Button" x:Key="MainMiddleButton">
  216. <Setter Property="FontWeight" Value="Bold"/>
  217. <Setter Property="Cursor" Value="Hand"/>
  218. <Setter Property="Foreground" Value="#FF004294" />
  219. <Setter Property="BorderBrush" Value="Blue" />
  220. <Setter Property="Margin" Value="5"/>
  221. <Setter Property="FontFamily" Value="Arial,SimSun" />
  222. <Setter Property="FontSize" Value="15"/>
  223. <Setter Property="VerticalAlignment" Value="Top" />
  224. <Setter Property="Height" Value="28"></Setter>
  225. <Setter Property="Width" Value="83"></Setter>
  226. <Setter Property="Background" >
  227. <Setter.Value>
  228. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/事件按钮.png">
  229. </ImageBrush>
  230. </Setter.Value>
  231. </Setter>
  232. <Style.Triggers>
  233. <Trigger Property="IsMouseOver" Value="True">
  234. <Setter Property="Background" >
  235. <Setter.Value>
  236. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/事件按钮_悬停.png">
  237. </ImageBrush>
  238. </Setter.Value>
  239. </Setter>
  240. </Trigger>
  241. <Trigger Property="IsPressed" Value="true">
  242. <Setter Property="Background" >
  243. <Setter.Value>
  244. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Main/事件按钮_点击.png">
  245. </ImageBrush>
  246. </Setter.Value>
  247. </Setter>
  248. </Trigger>
  249. </Style.Triggers>
  250. </Style>
  251. <!--登录窗口样式-->
  252. <Style TargetType="Button" x:Key="LoginButton">
  253. <Setter Property="Cursor" Value="Hand"/>
  254. <Setter Property="BorderBrush" Value="Blue" />
  255. <Setter Property="Margin" Value="5"/>
  256. <Setter Property="FontFamily" Value="Arial,SimSun" />
  257. <Setter Property="FontSize" Value="14"/>
  258. <Setter Property="VerticalAlignment" Value="Top" />
  259. <Setter Property="Height" Value="40"></Setter>
  260. <Setter Property="Width" Value="116"></Setter>
  261. <Setter Property="Background">
  262. <Setter.Value>
  263. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Login/按钮.png" />
  264. </Setter.Value>
  265. </Setter>
  266. <Setter Property="Template">
  267. <Setter.Value>
  268. <ControlTemplate TargetType="ButtonBase">
  269. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  270. <ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" Margin="{TemplateBinding Control.Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" />
  271. </Border>
  272. </ControlTemplate>
  273. </Setter.Value>
  274. </Setter>
  275. <Style.Triggers>
  276. <Trigger Property="IsMouseOver" Value="True">
  277. <Setter Property="Background" >
  278. <Setter.Value>
  279. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Login/按钮_悬停.png">
  280. </ImageBrush>
  281. </Setter.Value>
  282. </Setter>
  283. </Trigger>
  284. <!-- When the mouse is pressed, apply a bevel with a narrower BevelWidth to make the button appear to get pressed. -->
  285. <Trigger Property="IsFocused" Value="true">
  286. <Setter Property="Background" >
  287. <Setter.Value>
  288. <ImageBrush ImageSource="pack://application:,,,/MECF.Framework.Common;component/Resources/Login/按钮_点击.png">
  289. </ImageBrush>
  290. </Setter.Value>
  291. </Setter>
  292. </Trigger>
  293. </Style.Triggers>
  294. </Style>
  295. <!--按钮缩放,多用于PM气流图等界面-->
  296. <Style TargetType="Button" x:Key="SmallButton">
  297. <Setter Property="FontWeight" Value="Bold"/>
  298. <Setter Property="Cursor" Value="Hand"/>
  299. <Setter Property="Foreground" Value="#FF181C1F" />
  300. <Setter Property="Background" Value="CadetBlue" />
  301. <Setter Property="BorderBrush" Value="Blue" />
  302. <Setter Property="Margin" Value="5"/>
  303. <Setter Property="FontFamily" Value="Arial,SimSun" />
  304. <Setter Property="FontSize" Value="14"/>
  305. <Setter Property="VerticalAlignment" Value="Top" />
  306. <Setter Property="Height" Value="23"></Setter>
  307. <Setter Property="Width" Value="65"></Setter>
  308. <Setter Property="BitmapEffect" >
  309. <Setter.Value>
  310. <BevelBitmapEffect BevelWidth="2" />
  311. </Setter.Value>
  312. </Setter>
  313. <Style.Triggers>
  314. <Trigger Property="IsMouseOver" Value="True">
  315. <Setter Property="Foreground" Value="Green" />
  316. </Trigger>
  317. <Trigger Property="IsPressed" Value="true">
  318. <Setter Property="BitmapEffect" >
  319. <Setter.Value>
  320. <BevelBitmapEffect BevelWidth="3" />
  321. </Setter.Value>
  322. </Setter>
  323. </Trigger>
  324. </Style.Triggers>
  325. </Style>
  326. <!--Main Menu Button-->
  327. <SolidColorBrush x:Key="Menu_Main_BD" Color="#FF043963"/>
  328. <SolidColorBrush x:Key="Menu_Main_BG" Color="#94bcd7"/>
  329. <SolidColorBrush x:Key="Menu_Main_BG_Highlight" Color="#FF6ad7ff"/>
  330. <SolidColorBrush x:Key="Menu_Main_BG_Outer" Color="#FF989798"/>
  331. <SolidColorBrush x:Key="Menu_Main_BG_Inner" Color="#6ad7ff"/>
  332. <SolidColorBrush x:Key="Menu_Main_FG" Color="#FF00429c"/>
  333. <SolidColorBrush x:Key="Menu_Main_Selected_FG" Color="White"/>
  334. <!--反应腔盖-->
  335. <Style TargetType="Button" x:Key="ReactorMiniButtonStyle">
  336. <Setter Property="FontSize" Value="15" />
  337. <Setter Property="Focusable" Value="False" />
  338. <Setter Property="Cursor" Value="Hand" />
  339. </Style>
  340. </ResourceDictionary>