Loading.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <UserControl x:Name="panBack" x:Class="Loading"
  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. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  7. xmlns:my="clr-namespace:pcl"
  8. mc:Ignorable="d" Height="50" Width="50" MinWidth="50" MinHeight="50" MaxWidth="50" MaxHeight="50" BorderBrush="{DynamicResource Color4}">
  9. <Grid Width = "50" Height = "50">
  10. <Grid.Resources>
  11. <!-- Value Converters -->
  12. <!-- Particle Styling ,must to has RelativeSource -->
  13. <SolidColorBrush x:Key = "ParticleBackgroundColor" Color = "Transparent"/>
  14. <sys:Double x:Key = "ParticleOpacity">1</sys:Double>
  15. <sys:Double x:Key = "ParticleRadius">5</sys:Double>
  16. <sys:Double x:Key = "StartingPointX">0</sys:Double>
  17. <sys:Double x:Key = "StartingPointY">-20</sys:Double>
  18. <sys:Double x:Key = "RotationPointX">0.5</sys:Double>
  19. <sys:Double x:Key = "RotationPointY">0.5</sys:Double>
  20. <!-- Particle Origin Angles -->
  21. <sys:Double x:Key = "ParticleOriginAngleP0">205</sys:Double>
  22. <sys:Double x:Key = "ParticleOriginAngleP1">199</sys:Double>
  23. <sys:Double x:Key = "ParticleOriginAngleP2">193</sys:Double>
  24. <sys:Double x:Key = "ParticleOriginAngleP3">187</sys:Double>
  25. <sys:Double x:Key = "ParticleOriginAngleP4">181</sys:Double>
  26. <Style x:Key = "EllipseStyle" TargetType = "Ellipse">
  27. <Setter Property = "Width" Value = "{StaticResource ParticleRadius}"/>
  28. <Setter Property = "Height" Value = "{StaticResource ParticleRadius}"/>
  29. <Setter Property = "Fill" Value = "{Binding BorderBrush, ElementName=panBack}"/>
  30. <Setter Property = "RenderTransformOrigin" Value = "0.5, 0.5"/>
  31. <Setter Property = "Opacity" Value = "{StaticResource ParticleOpacity}"/>
  32. </Style>
  33. </Grid.Resources>
  34. <Canvas Width = "1" Height = "1" Margin="0,0,0,0">
  35. <Canvas.Triggers>
  36. <EventTrigger RoutedEvent = "Canvas.Loaded">
  37. <EventTrigger.Actions>
  38. <BeginStoryboard>
  39. <Storyboard BeginTime = "0:0:0.0" Duration = "0:0:6.6" RepeatBehavior = "Forever" TargetName = "p0" TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)">
  40. <DoubleAnimationUsingKeyFrames BeginTime = "00:00:00.000" Duration = "0:0:6.6">
  41. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="300" KeyTime="0:0:1.1"/>
  42. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="600" KeyTime="0:0:2.2"/>
  43. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="900" KeyTime="0:0:3.3"/>
  44. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1200" KeyTime="0:0:4.4"/>
  45. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1500" KeyTime="0:0:5.5"/>
  46. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1800" KeyTime="0:0:6.6"/>
  47. </DoubleAnimationUsingKeyFrames>
  48. </Storyboard>
  49. </BeginStoryboard>
  50. <BeginStoryboard>
  51. <Storyboard BeginTime = "0:0:0.16" Duration = "0:0:6.6" RepeatBehavior = "Forever" TargetName = "p1" TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)">
  52. <DoubleAnimationUsingKeyFrames BeginTime = "00:00:00.000" Duration = "0:0:6.6">
  53. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="300" KeyTime="0:0:1.1"/>
  54. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="600" KeyTime="0:0:2.2"/>
  55. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="900" KeyTime="0:0:3.3"/>
  56. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1200" KeyTime="0:0:4.4"/>
  57. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1500" KeyTime="0:0:5.5"/>
  58. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1800" KeyTime="0:0:6.6"/>
  59. </DoubleAnimationUsingKeyFrames>
  60. </Storyboard>
  61. </BeginStoryboard>
  62. <BeginStoryboard>
  63. <Storyboard BeginTime = "0:0:0.32" Duration = "0:0:6.6" RepeatBehavior = "Forever" TargetName = "p2" TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)">
  64. <DoubleAnimationUsingKeyFrames BeginTime = "00:00:00.000" Duration = "0:0:6.6">
  65. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="300" KeyTime="0:0:1.1"/>
  66. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="600" KeyTime="0:0:2.2"/>
  67. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="900" KeyTime="0:0:3.3"/>
  68. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1200" KeyTime="0:0:4.4"/>
  69. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1500" KeyTime="0:0:5.5"/>
  70. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1800" KeyTime="0:0:6.6"/>
  71. </DoubleAnimationUsingKeyFrames>
  72. </Storyboard>
  73. </BeginStoryboard>
  74. <BeginStoryboard>
  75. <Storyboard BeginTime = "0:0:0.48" Duration = "0:0:6.6" RepeatBehavior = "Forever" TargetName = "p3" TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)">
  76. <DoubleAnimationUsingKeyFrames BeginTime = "00:00:00.000" Duration = "0:0:6.6">
  77. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="300" KeyTime="0:0:1.1"/>
  78. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="600" KeyTime="0:0:2.2"/>
  79. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="900" KeyTime="0:0:3.3"/>
  80. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1200" KeyTime="0:0:4.4"/>
  81. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1500" KeyTime="0:0:5.5"/>
  82. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1800" KeyTime="0:0:6.6"/>
  83. </DoubleAnimationUsingKeyFrames>
  84. </Storyboard>
  85. </BeginStoryboard>
  86. <BeginStoryboard>
  87. <Storyboard BeginTime = "0:0:0.64" Duration = "0:0:6.6" RepeatBehavior = "Forever" TargetName = "p4" TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)">
  88. <DoubleAnimationUsingKeyFrames BeginTime = "00:00:00.000" Duration = "0:0:6.6">
  89. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="300" KeyTime="0:0:1.1"/>
  90. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="600" KeyTime="0:0:2.2"/>
  91. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="900" KeyTime="0:0:3.3"/>
  92. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1200" KeyTime="0:0:4.4"/>
  93. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1500" KeyTime="0:0:5.5"/>
  94. <SplineDoubleKeyFrame KeySpline="0.75,0.22 0.25,0.78" Value="1800" KeyTime="0:0:6.6"/>
  95. </DoubleAnimationUsingKeyFrames>
  96. </Storyboard>
  97. </BeginStoryboard>
  98. </EventTrigger.Actions>
  99. </EventTrigger>
  100. </Canvas.Triggers>
  101. <Border
  102. x:Name = "p0"
  103. Background = "{StaticResource ParticleBackgroundColor}"
  104. Opacity = "{StaticResource ParticleOpacity}">
  105. <Border.RenderTransform>
  106. <RotateTransform/>
  107. </Border.RenderTransform>
  108. <Border.RenderTransformOrigin>
  109. <Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
  110. </Border.RenderTransformOrigin>
  111. <Ellipse Style = "{StaticResource EllipseStyle}">
  112. <Ellipse.RenderTransform>
  113. <TransformGroup>
  114. <TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
  115. <RotateTransform Angle = "{StaticResource ParticleOriginAngleP0}"/>
  116. </TransformGroup>
  117. </Ellipse.RenderTransform>
  118. </Ellipse>
  119. </Border>
  120. <Border
  121. x:Name = "p1"
  122. Background = "{StaticResource ParticleBackgroundColor}"
  123. Opacity = "{StaticResource ParticleOpacity}">
  124. <Border.RenderTransform>
  125. <RotateTransform/>
  126. </Border.RenderTransform>
  127. <Border.RenderTransformOrigin>
  128. <Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
  129. </Border.RenderTransformOrigin>
  130. <Ellipse Style = "{StaticResource EllipseStyle}">
  131. <Ellipse.RenderTransform>
  132. <TransformGroup>
  133. <TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
  134. <RotateTransform Angle = "{StaticResource ParticleOriginAngleP1}"/>
  135. </TransformGroup>
  136. </Ellipse.RenderTransform>
  137. </Ellipse>
  138. </Border>
  139. <Border
  140. x:Name = "p2"
  141. Background = "{StaticResource ParticleBackgroundColor}"
  142. Opacity = "{StaticResource ParticleOpacity}">
  143. <Border.RenderTransform>
  144. <RotateTransform/>
  145. </Border.RenderTransform>
  146. <Border.RenderTransformOrigin>
  147. <Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
  148. </Border.RenderTransformOrigin>
  149. <Ellipse Style = "{StaticResource EllipseStyle}">
  150. <Ellipse.RenderTransform>
  151. <TransformGroup>
  152. <TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
  153. <RotateTransform Angle = "{StaticResource ParticleOriginAngleP2}"/>
  154. </TransformGroup>
  155. </Ellipse.RenderTransform>
  156. </Ellipse>
  157. </Border>
  158. <Border
  159. x:Name = "p3"
  160. Background = "{StaticResource ParticleBackgroundColor}"
  161. Opacity = "{StaticResource ParticleOpacity}">
  162. <Border.RenderTransform>
  163. <RotateTransform/>
  164. </Border.RenderTransform>
  165. <Border.RenderTransformOrigin>
  166. <Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
  167. </Border.RenderTransformOrigin>
  168. <Ellipse Style = "{StaticResource EllipseStyle}">
  169. <Ellipse.RenderTransform>
  170. <TransformGroup>
  171. <TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
  172. <RotateTransform Angle = "{StaticResource ParticleOriginAngleP3}"/>
  173. </TransformGroup>
  174. </Ellipse.RenderTransform>
  175. </Ellipse>
  176. </Border>
  177. <Border
  178. x:Name = "p4"
  179. Background = "{StaticResource ParticleBackgroundColor}"
  180. Opacity = "{StaticResource ParticleOpacity}">
  181. <Border.RenderTransform>
  182. <RotateTransform/>
  183. </Border.RenderTransform>
  184. <Border.RenderTransformOrigin>
  185. <Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
  186. </Border.RenderTransformOrigin>
  187. <Ellipse Style = "{StaticResource EllipseStyle}">
  188. <Ellipse.RenderTransform>
  189. <TransformGroup>
  190. <TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
  191. <RotateTransform Angle = "{StaticResource ParticleOriginAngleP4}"/>
  192. </TransformGroup>
  193. </Ellipse.RenderTransform>
  194. </Ellipse>
  195. </Border>
  196. </Canvas>
  197. </Grid>
  198. </UserControl>