ButtonStyle.xaml 18 KB

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