WpfWindturbine.xaml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <UserControl x:Class="IntelligentControlForsx.MyControls.WpfWindturbine"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. mc:Ignorable="d"
  7. d:DesignHeight="50" d:DesignWidth="66" Width="50" Height="66">
  8. <UserControl.Resources>
  9. <Storyboard x:Key="OnMouseEnter1">
  10. <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse">
  11. <EasingColorKeyFrame KeyTime="0:0:0.1" Value="White"/>
  12. </ColorAnimationUsingKeyFrames>
  13. <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="path">
  14. <EasingColorKeyFrame KeyTime="0:0:0.1" Value="White"/>
  15. </ColorAnimationUsingKeyFrames>
  16. <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="path1">
  17. <EasingColorKeyFrame KeyTime="0:0:0.1" Value="White"/>
  18. </ColorAnimationUsingKeyFrames>
  19. </Storyboard>
  20. <Storyboard x:Key="OnMouseLeave1">
  21. <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="ellipse">
  22. <EasingColorKeyFrame KeyTime="0" Value="White"/>
  23. <EasingColorKeyFrame KeyTime="0:0:0.1" Value="Black"/>
  24. </ColorAnimationUsingKeyFrames>
  25. <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="path">
  26. <EasingColorKeyFrame KeyTime="0" Value="White"/>
  27. <EasingColorKeyFrame KeyTime="0:0:0.1" Value="Black"/>
  28. </ColorAnimationUsingKeyFrames>
  29. <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)" Storyboard.TargetName="path1">
  30. <EasingColorKeyFrame KeyTime="0" Value="White"/>
  31. <EasingColorKeyFrame KeyTime="0:0:0.1" Value="Black"/>
  32. </ColorAnimationUsingKeyFrames>
  33. </Storyboard>
  34. </UserControl.Resources>
  35. <UserControl.Triggers>
  36. <EventTrigger RoutedEvent="Mouse.MouseEnter">
  37. <BeginStoryboard Storyboard="{StaticResource OnMouseEnter1}"/>
  38. </EventTrigger>
  39. <EventTrigger RoutedEvent="Mouse.MouseLeave">
  40. <BeginStoryboard x:Name="OnMouseLeave1_BeginStoryboard" Storyboard="{StaticResource OnMouseLeave1}"/>
  41. </EventTrigger>
  42. </UserControl.Triggers>
  43. <Grid MouseDown="Grid_MouseDown" Cursor="Hand" MouseEnter="Grid_MouseEnter_1" MouseLeave="Grid_MouseLeave_1">
  44. <VisualStateManager.VisualStateGroups>
  45. <VisualStateGroup x:Name="WindturbineState">
  46. <VisualState x:Name="run">
  47. <Storyboard>
  48. <DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path1">
  49. <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
  50. <EasingDoubleKeyFrame KeyTime="0:0:2" Value="360"/>
  51. </DoubleAnimationUsingKeyFrames>
  52. <PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)" Storyboard.TargetName="path1">
  53. <EasingPointKeyFrame KeyTime="0" Value="0.515,0.613"/>
  54. </PointAnimationUsingKeyFrames>
  55. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
  56. <DiscreteObjectKeyFrame KeyTime="0">
  57. <DiscreteObjectKeyFrame.Value>
  58. <SolidColorBrush Color="#FF2DFFFF"/>
  59. </DiscreteObjectKeyFrame.Value>
  60. </DiscreteObjectKeyFrame>
  61. </ObjectAnimationUsingKeyFrames>
  62. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path">
  63. <DiscreteObjectKeyFrame KeyTime="0">
  64. <DiscreteObjectKeyFrame.Value>
  65. <SolidColorBrush Color="#FF2DFFFF"/>
  66. </DiscreteObjectKeyFrame.Value>
  67. </DiscreteObjectKeyFrame>
  68. </ObjectAnimationUsingKeyFrames>
  69. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path1">
  70. <DiscreteObjectKeyFrame KeyTime="0">
  71. <DiscreteObjectKeyFrame.Value>
  72. <SolidColorBrush Color="#FF2DFFFF"/>
  73. </DiscreteObjectKeyFrame.Value>
  74. </DiscreteObjectKeyFrame>
  75. </ObjectAnimationUsingKeyFrames>
  76. </Storyboard>
  77. </VisualState>
  78. <VisualState x:Name="stop">
  79. <Storyboard>
  80. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
  81. <DiscreteObjectKeyFrame KeyTime="0">
  82. <DiscreteObjectKeyFrame.Value>
  83. <SolidColorBrush Color="Red"/>
  84. </DiscreteObjectKeyFrame.Value>
  85. </DiscreteObjectKeyFrame>
  86. </ObjectAnimationUsingKeyFrames>
  87. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path">
  88. <DiscreteObjectKeyFrame KeyTime="0">
  89. <DiscreteObjectKeyFrame.Value>
  90. <SolidColorBrush Color="Red"/>
  91. </DiscreteObjectKeyFrame.Value>
  92. </DiscreteObjectKeyFrame>
  93. </ObjectAnimationUsingKeyFrames>
  94. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path1">
  95. <DiscreteObjectKeyFrame KeyTime="0">
  96. <DiscreteObjectKeyFrame.Value>
  97. <SolidColorBrush Color="Red"/>
  98. </DiscreteObjectKeyFrame.Value>
  99. </DiscreteObjectKeyFrame>
  100. </ObjectAnimationUsingKeyFrames>
  101. </Storyboard>
  102. </VisualState>
  103. <VisualState x:Name="standby">
  104. <Storyboard>
  105. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
  106. <DiscreteObjectKeyFrame KeyTime="0">
  107. <DiscreteObjectKeyFrame.Value>
  108. <SolidColorBrush Color="Lime"/>
  109. </DiscreteObjectKeyFrame.Value>
  110. </DiscreteObjectKeyFrame>
  111. </ObjectAnimationUsingKeyFrames>
  112. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path">
  113. <DiscreteObjectKeyFrame KeyTime="0">
  114. <DiscreteObjectKeyFrame.Value>
  115. <SolidColorBrush Color="Lime"/>
  116. </DiscreteObjectKeyFrame.Value>
  117. </DiscreteObjectKeyFrame>
  118. </ObjectAnimationUsingKeyFrames>
  119. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path1">
  120. <DiscreteObjectKeyFrame KeyTime="0">
  121. <DiscreteObjectKeyFrame.Value>
  122. <SolidColorBrush Color="Lime"/>
  123. </DiscreteObjectKeyFrame.Value>
  124. </DiscreteObjectKeyFrame>
  125. </ObjectAnimationUsingKeyFrames>
  126. </Storyboard>
  127. </VisualState>
  128. <VisualState x:Name="repair">
  129. <Storyboard>
  130. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
  131. <DiscreteObjectKeyFrame KeyTime="0">
  132. <DiscreteObjectKeyFrame.Value>
  133. <SolidColorBrush Color="Yellow"/>
  134. </DiscreteObjectKeyFrame.Value>
  135. </DiscreteObjectKeyFrame>
  136. </ObjectAnimationUsingKeyFrames>
  137. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path">
  138. <DiscreteObjectKeyFrame KeyTime="0">
  139. <DiscreteObjectKeyFrame.Value>
  140. <SolidColorBrush Color="Yellow"/>
  141. </DiscreteObjectKeyFrame.Value>
  142. </DiscreteObjectKeyFrame>
  143. </ObjectAnimationUsingKeyFrames>
  144. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path1">
  145. <DiscreteObjectKeyFrame KeyTime="0">
  146. <DiscreteObjectKeyFrame.Value>
  147. <SolidColorBrush Color="Yellow"/>
  148. </DiscreteObjectKeyFrame.Value>
  149. </DiscreteObjectKeyFrame>
  150. </ObjectAnimationUsingKeyFrames>
  151. </Storyboard>
  152. </VisualState>
  153. <VisualState x:Name="interrupt">
  154. <Storyboard>
  155. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
  156. <DiscreteObjectKeyFrame KeyTime="0">
  157. <DiscreteObjectKeyFrame.Value>
  158. <SolidColorBrush Color="Gray"/>
  159. </DiscreteObjectKeyFrame.Value>
  160. </DiscreteObjectKeyFrame>
  161. </ObjectAnimationUsingKeyFrames>
  162. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path">
  163. <DiscreteObjectKeyFrame KeyTime="0">
  164. <DiscreteObjectKeyFrame.Value>
  165. <SolidColorBrush Color="Gray"/>
  166. </DiscreteObjectKeyFrame.Value>
  167. </DiscreteObjectKeyFrame>
  168. </ObjectAnimationUsingKeyFrames>
  169. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path1">
  170. <DiscreteObjectKeyFrame KeyTime="0">
  171. <DiscreteObjectKeyFrame.Value>
  172. <SolidColorBrush Color="Gray"/>
  173. </DiscreteObjectKeyFrame.Value>
  174. </DiscreteObjectKeyFrame>
  175. </ObjectAnimationUsingKeyFrames>
  176. </Storyboard>
  177. </VisualState>
  178. <VisualState x:Name="powercuts">
  179. <Storyboard>
  180. <DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="path1">
  181. <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
  182. <EasingDoubleKeyFrame KeyTime="0:0:4" Value="360"/>
  183. </DoubleAnimationUsingKeyFrames>
  184. <PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)" Storyboard.TargetName="path1">
  185. <EasingPointKeyFrame KeyTime="0" Value="0.515,0.613"/>
  186. </PointAnimationUsingKeyFrames>
  187. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
  188. <DiscreteObjectKeyFrame KeyTime="0">
  189. <DiscreteObjectKeyFrame.Value>
  190. <SolidColorBrush Color="#FFB200B2"/>
  191. </DiscreteObjectKeyFrame.Value>
  192. </DiscreteObjectKeyFrame>
  193. </ObjectAnimationUsingKeyFrames>
  194. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path">
  195. <DiscreteObjectKeyFrame KeyTime="0">
  196. <DiscreteObjectKeyFrame.Value>
  197. <SolidColorBrush Color="#FFB200B2"/>
  198. </DiscreteObjectKeyFrame.Value>
  199. </DiscreteObjectKeyFrame>
  200. </ObjectAnimationUsingKeyFrames>
  201. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path1">
  202. <DiscreteObjectKeyFrame KeyTime="0">
  203. <DiscreteObjectKeyFrame.Value>
  204. <SolidColorBrush Color="#FFB200B2"/>
  205. </DiscreteObjectKeyFrame.Value>
  206. </DiscreteObjectKeyFrame>
  207. </ObjectAnimationUsingKeyFrames>
  208. </Storyboard>
  209. </VisualState>
  210. <VisualState x:Name="staticrun">
  211. <Storyboard>
  212. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path1">
  213. <DiscreteObjectKeyFrame KeyTime="0">
  214. <DiscreteObjectKeyFrame.Value>
  215. <SolidColorBrush Color="#FF2DFFFF"/>
  216. </DiscreteObjectKeyFrame.Value>
  217. </DiscreteObjectKeyFrame>
  218. </ObjectAnimationUsingKeyFrames>
  219. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path">
  220. <DiscreteObjectKeyFrame KeyTime="0">
  221. <DiscreteObjectKeyFrame.Value>
  222. <SolidColorBrush Color="#FF2DFFFF"/>
  223. </DiscreteObjectKeyFrame.Value>
  224. </DiscreteObjectKeyFrame>
  225. </ObjectAnimationUsingKeyFrames>
  226. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
  227. <DiscreteObjectKeyFrame KeyTime="0">
  228. <DiscreteObjectKeyFrame.Value>
  229. <SolidColorBrush Color="#FF2DFFFF"/>
  230. </DiscreteObjectKeyFrame.Value>
  231. </DiscreteObjectKeyFrame>
  232. </ObjectAnimationUsingKeyFrames>
  233. </Storyboard>
  234. </VisualState>
  235. <VisualState x:Name="powercuts2">
  236. <Storyboard>
  237. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path1">
  238. <DiscreteObjectKeyFrame KeyTime="0">
  239. <DiscreteObjectKeyFrame.Value>
  240. <SolidColorBrush Color="#FFB200B2"/>
  241. </DiscreteObjectKeyFrame.Value>
  242. </DiscreteObjectKeyFrame>
  243. </ObjectAnimationUsingKeyFrames>
  244. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="path">
  245. <DiscreteObjectKeyFrame KeyTime="0">
  246. <DiscreteObjectKeyFrame.Value>
  247. <SolidColorBrush Color="#FFB200B2"/>
  248. </DiscreteObjectKeyFrame.Value>
  249. </DiscreteObjectKeyFrame>
  250. </ObjectAnimationUsingKeyFrames>
  251. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill)" Storyboard.TargetName="ellipse">
  252. <DiscreteObjectKeyFrame KeyTime="0">
  253. <DiscreteObjectKeyFrame.Value>
  254. <SolidColorBrush Color="#FFB200B2"/>
  255. </DiscreteObjectKeyFrame.Value>
  256. </DiscreteObjectKeyFrame>
  257. </ObjectAnimationUsingKeyFrames>
  258. </Storyboard>
  259. </VisualState>
  260. </VisualStateGroup>
  261. </VisualStateManager.VisualStateGroups>
  262. <Ellipse x:Name="ellipse" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="19" Margin="14.625,47,0,0" Stroke="Black" VerticalAlignment="Top" Width="29.375"/>
  263. <Path x:Name="path" Data="M32.5,57.75 L25.125,57.375 25.875,31.5 23.375,31.5 21.375,30.625 21.125,27.875 21.5,25.5 31.625,18 34.625,18 35.875,18.875 35.875,21.25 34.5,23.625 32.625,25.625 31,27 30.125,27.5 z" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="40.75" Margin="21.125,18,0,0" Stretch="Fill" Stroke="Black" VerticalAlignment="Top" Width="15.75"/>
  264. <Path x:Name="path1" Fill="#FFF4F4F5" HorizontalAlignment="Left" Height="42.625" Margin="2.333,2.125,0,0" Stroke="Black" VerticalAlignment="Top" Width="44.667" RenderTransformOrigin="0.5,0.5">
  265. <Path.Data>
  266. <PathGeometry>
  267. <PathFigure IsClosed="True" StartPoint="19.9999999857743,3.20833333333334">
  268. <LineSegment Point="19.5003333290418,22.875"/>
  269. <LineSegment Point="17.4682406644974,26.0116934583612"/>
  270. <LineSegment Point="1.33333331910768,36.5416666666668"/>
  271. <LineSegment Point="3.83333331910769,40.7083333333335"/>
  272. <LineSegment Point="21.1666666524412,30.2083333333335"/>
  273. <LineSegment Point="22.6666666524411,30.2083333333335"/>
  274. <LineSegment Point="24.3333333191078,29.8750000000002"/>
  275. <LineSegment Point="41.8333333191076,39.7083333333334"/>
  276. <LineSegment Point="43.833333319108,35.7083333333333"/>
  277. <LineSegment Point="27.0419999957085,25.2916666666667"/>
  278. <LineSegment Point="25.1666666524412,22.2083333333332"/>
  279. <LineSegment Point="24.6666666524412,3.20833333333334"/>
  280. </PathFigure>
  281. </PathGeometry>
  282. </Path.Data>
  283. <Path.RenderTransform>
  284. <TransformGroup>
  285. <ScaleTransform/>
  286. <SkewTransform/>
  287. <RotateTransform/>
  288. <TranslateTransform/>
  289. </TransformGroup>
  290. </Path.RenderTransform>
  291. <Path.CacheMode>
  292. <BitmapCache/>
  293. </Path.CacheMode>
  294. </Path>
  295. </Grid>
  296. </UserControl>