ButtonStyle.xaml 15 KB

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