You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

351 lines
23 KiB

  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:bpa="clr-namespace:BPA.UIControl">
  4. <ResourceDictionary.MergedDictionaries>
  5. <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/Resources/Default.xaml" />
  6. </ResourceDictionary.MergedDictionaries>
  7. <Style x:Key="RubyerLoading" TargetType="{x:Type bpa:Loading}">
  8. <Setter Property="Background" Value="{DynamicResource BorderLight}" />
  9. <Setter Property="BorderThickness" Value="0" />
  10. <Setter Property="BorderBrush" Value="Transparent" />
  11. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  12. <Setter Property="FocusedBrush" Value="{DynamicResource Primary}" />
  13. <Setter Property="StrokeThickness" Value="5" />
  14. <Setter Property="Progress" Value="0.01" />
  15. <Setter Property="Focusable" Value="False" />
  16. <Setter Property="IsTabStop" Value="False" />
  17. <Setter Property="Diameter" Value="30" />
  18. <Setter Property="HorizontalAlignment" Value="Center" />
  19. <Setter Property="VerticalAlignment" Value="Center" />
  20. <Setter Property="HorizontalContentAlignment" Value="Center" />
  21. <Setter Property="VerticalContentAlignment" Value="Center" />
  22. <Setter Property="Template">
  23. <Setter.Value>
  24. <ControlTemplate TargetType="{x:Type bpa:Loading}">
  25. <Grid>
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="Auto" />
  28. <RowDefinition Height="Auto" />
  29. </Grid.RowDefinitions>
  30. <Grid>
  31. <Rectangle x:Name="background"
  32. Width="{TemplateBinding Diameter}"
  33. Height="{TemplateBinding Diameter}"
  34. Stroke="{TemplateBinding Background}"
  35. StrokeThickness="{TemplateBinding StrokeThickness}">
  36. <Rectangle.RadiusX>
  37. <MultiBinding Converter="{StaticResource MathDivideConverter}">
  38. <Binding ElementName="background" Path="ActualWidth" />
  39. <Binding Source="2" />
  40. </MultiBinding>
  41. </Rectangle.RadiusX>
  42. <Rectangle.RadiusY>
  43. <MultiBinding Converter="{StaticResource MathDivideConverter}">
  44. <Binding ElementName="background" Path="ActualHeight" />
  45. <Binding Source="2" />
  46. </MultiBinding>
  47. </Rectangle.RadiusY>
  48. </Rectangle>
  49. <Rectangle x:Name="loading"
  50. Width="{TemplateBinding Diameter}"
  51. Height="{TemplateBinding Diameter}"
  52. RadiusX="{Binding RadiusX, ElementName=background}"
  53. RadiusY="{Binding RadiusY, ElementName=background}"
  54. RenderTransformOrigin="0.5 0.5"
  55. Stroke="{TemplateBinding FocusedBrush}"
  56. StrokeDashArray="{TemplateBinding StrokeDashArray}"
  57. StrokeThickness="{TemplateBinding StrokeThickness}">
  58. <Rectangle.RenderTransform>
  59. <RotateTransform x:Name="loadingAngle" Angle="0" />
  60. </Rectangle.RenderTransform>
  61. </Rectangle>
  62. </Grid>
  63. <ContentPresenter x:Name="contentPresenter"
  64. Grid.Row="1"
  65. Margin="0 5 0 0"
  66. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  67. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  68. Focusable="False"
  69. RecognizesAccessKey="True"
  70. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  71. </Grid>
  72. <ControlTemplate.Triggers>
  73. <Trigger Property="IsEnabled" Value="False">
  74. <Setter Property="Opacity" Value="{DynamicResource UnenableOpcity}" />
  75. </Trigger>
  76. <Trigger Property="IsEnabled" Value="True">
  77. <Trigger.EnterActions>
  78. <BeginStoryboard>
  79. <Storyboard RepeatBehavior="Forever">
  80. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="loadingAngle" Storyboard.TargetProperty="Angle">
  81. <EasingDoubleKeyFrame KeyTime="0" Value="0" />
  82. <EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="90" />
  83. <EasingDoubleKeyFrame KeyTime="0:0:0.751" Value="-90" />
  84. <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0" />
  85. <EasingDoubleKeyFrame KeyTime="0:0:1.501" Value="-180" />
  86. <EasingDoubleKeyFrame KeyTime="0:0:2.25" Value="-90" />
  87. <EasingDoubleKeyFrame KeyTime="0:0:2.251" Value="-270" />
  88. <EasingDoubleKeyFrame KeyTime="0:0:3" Value="-180" />
  89. <EasingDoubleKeyFrame KeyTime="0:0:3.01" Value="0" />
  90. </DoubleAnimationUsingKeyFrames>
  91. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Progress">
  92. <EasingDoubleKeyFrame KeyTime="0" Value="0.01" />
  93. <EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="1" />
  94. <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="0.01" />
  95. <EasingDoubleKeyFrame KeyTime="0:0:2.25" Value="1" />
  96. <EasingDoubleKeyFrame KeyTime="0:0:3" Value="0.01" />
  97. </DoubleAnimationUsingKeyFrames>
  98. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="loading" Storyboard.TargetProperty="FlowDirection">
  99. <DiscreteObjectKeyFrame KeyTime="0">
  100. <DiscreteObjectKeyFrame.Value>
  101. <FlowDirection>LeftToRight</FlowDirection>
  102. </DiscreteObjectKeyFrame.Value>
  103. </DiscreteObjectKeyFrame>
  104. <DiscreteObjectKeyFrame KeyTime="0:0:0.75">
  105. <DiscreteObjectKeyFrame.Value>
  106. <FlowDirection>RightToLeft</FlowDirection>
  107. </DiscreteObjectKeyFrame.Value>
  108. </DiscreteObjectKeyFrame>
  109. <DiscreteObjectKeyFrame KeyTime="0:0:1.5">
  110. <DiscreteObjectKeyFrame.Value>
  111. <FlowDirection>LeftToRight</FlowDirection>
  112. </DiscreteObjectKeyFrame.Value>
  113. </DiscreteObjectKeyFrame>
  114. <DiscreteObjectKeyFrame KeyTime="0:0:2.25">
  115. <DiscreteObjectKeyFrame.Value>
  116. <FlowDirection>RightToLeft</FlowDirection>
  117. </DiscreteObjectKeyFrame.Value>
  118. </DiscreteObjectKeyFrame>
  119. <DiscreteObjectKeyFrame KeyTime="0:0:3">
  120. <DiscreteObjectKeyFrame.Value>
  121. <FlowDirection>LeftToRight</FlowDirection>
  122. </DiscreteObjectKeyFrame.Value>
  123. </DiscreteObjectKeyFrame>
  124. </ObjectAnimationUsingKeyFrames>
  125. </Storyboard>
  126. </BeginStoryboard>
  127. </Trigger.EnterActions>
  128. </Trigger>
  129. <Trigger Property="Content" Value="{x:Null}">
  130. <Setter TargetName="contentPresenter" Property="Margin" Value="0" />
  131. </Trigger>
  132. </ControlTemplate.Triggers>
  133. </ControlTemplate>
  134. </Setter.Value>
  135. </Setter>
  136. </Style>
  137. <Style x:Key="WaveLoading" TargetType="{x:Type bpa:Loading}">
  138. <Setter Property="StrokeThickness" Value="3" />
  139. <Setter Property="Diameter" Value="15" />
  140. <Setter Property="Template">
  141. <Setter.Value>
  142. <ControlTemplate TargetType="{x:Type bpa:Loading}">
  143. <Grid>
  144. <Grid.RowDefinitions>
  145. <RowDefinition Height="*" />
  146. <RowDefinition Height="Auto" />
  147. </Grid.RowDefinitions>
  148. <StackPanel Height="{TemplateBinding Diameter}"
  149. HorizontalAlignment="Center"
  150. Orientation="Horizontal">
  151. <Border Width="{TemplateBinding StrokeThickness}"
  152. Margin="1 0"
  153. Background="{TemplateBinding FocusedBrush}"
  154. RenderTransformOrigin="0.5 0.5">
  155. <Border.RenderTransform>
  156. <ScaleTransform x:Name="s1" ScaleY="1" />
  157. </Border.RenderTransform>
  158. </Border>
  159. <Border Width="{TemplateBinding StrokeThickness}"
  160. Margin="1 0"
  161. Background="{TemplateBinding FocusedBrush}"
  162. RenderTransformOrigin="0.5 0.5">
  163. <Border.RenderTransform>
  164. <ScaleTransform x:Name="s2" ScaleY="1" />
  165. </Border.RenderTransform>
  166. </Border>
  167. <Border Width="{TemplateBinding StrokeThickness}"
  168. Margin="1 0"
  169. Background="{TemplateBinding FocusedBrush}"
  170. RenderTransformOrigin="0.5 0.5">
  171. <Border.RenderTransform>
  172. <ScaleTransform x:Name="s3" ScaleY="1" />
  173. </Border.RenderTransform>
  174. </Border>
  175. <Border Width="{TemplateBinding StrokeThickness}"
  176. Margin="1 0"
  177. Background="{TemplateBinding FocusedBrush}"
  178. RenderTransformOrigin="0.5 0.5">
  179. <Border.RenderTransform>
  180. <ScaleTransform x:Name="s4" ScaleY="1" />
  181. </Border.RenderTransform>
  182. </Border>
  183. <Border Width="{TemplateBinding StrokeThickness}"
  184. Margin="1 0"
  185. Background="{TemplateBinding FocusedBrush}"
  186. RenderTransformOrigin="0.5 0.5">
  187. <Border.RenderTransform>
  188. <ScaleTransform x:Name="s5" ScaleY="1" />
  189. </Border.RenderTransform>
  190. </Border>
  191. </StackPanel>
  192. <ContentPresenter x:Name="contentPresenter"
  193. Grid.Row="1"
  194. Margin="0 5 0 0"
  195. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  196. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  197. Focusable="False"
  198. RecognizesAccessKey="True"
  199. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  200. </Grid>
  201. <ControlTemplate.Triggers>
  202. <Trigger Property="IsEnabled" Value="False">
  203. <Setter Property="Opacity" Value="{DynamicResource UnenableOpcity}" />
  204. </Trigger>
  205. <Trigger Property="IsEnabled" Value="True">
  206. <Trigger.EnterActions>
  207. <BeginStoryboard>
  208. <Storyboard RepeatBehavior="Forever">
  209. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s1" Storyboard.TargetProperty="ScaleY">
  210. <EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="2" />
  211. <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1" />
  212. <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1" />
  213. </DoubleAnimationUsingKeyFrames>
  214. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s2" Storyboard.TargetProperty="ScaleY">
  215. <EasingDoubleKeyFrame KeyTime="0:0:0.125" Value="1" />
  216. <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="2" />
  217. <EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="1" />
  218. <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1" />
  219. </DoubleAnimationUsingKeyFrames>
  220. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s3" Storyboard.TargetProperty="ScaleY">
  221. <EasingDoubleKeyFrame KeyTime="0:0:0.325" Value="1" />
  222. <EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="2" />
  223. <EasingDoubleKeyFrame KeyTime="0:0:1" Value="1" />
  224. <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1" />
  225. </DoubleAnimationUsingKeyFrames>
  226. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s4" Storyboard.TargetProperty="ScaleY">
  227. <EasingDoubleKeyFrame KeyTime="0:0:0.625" Value="1" />
  228. <EasingDoubleKeyFrame KeyTime="0:0:1" Value="2" />
  229. <EasingDoubleKeyFrame KeyTime="0:0:1.25" Value="1" />
  230. <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1" />
  231. </DoubleAnimationUsingKeyFrames>
  232. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s5" Storyboard.TargetProperty="ScaleY">
  233. <EasingDoubleKeyFrame KeyTime="0:0:0.875" Value="1" />
  234. <EasingDoubleKeyFrame KeyTime="0:0:1.25" Value="2" />
  235. <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1" />
  236. </DoubleAnimationUsingKeyFrames>
  237. </Storyboard>
  238. </BeginStoryboard>
  239. </Trigger.EnterActions>
  240. <Trigger.ExitActions>
  241. <BeginStoryboard>
  242. <Storyboard RepeatBehavior="Forever">
  243. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s1" Storyboard.TargetProperty="ScaleY">
  244. <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1" />
  245. </DoubleAnimationUsingKeyFrames>
  246. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s2" Storyboard.TargetProperty="ScaleY">
  247. <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1" />
  248. </DoubleAnimationUsingKeyFrames>
  249. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s3" Storyboard.TargetProperty="ScaleY">
  250. <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1" />
  251. </DoubleAnimationUsingKeyFrames>
  252. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s4" Storyboard.TargetProperty="ScaleY">
  253. <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1" />
  254. </DoubleAnimationUsingKeyFrames>
  255. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="s5" Storyboard.TargetProperty="ScaleY">
  256. <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1" />
  257. </DoubleAnimationUsingKeyFrames>
  258. </Storyboard>
  259. </BeginStoryboard>
  260. </Trigger.ExitActions>
  261. </Trigger>
  262. <Trigger Property="Content" Value="{x:Null}">
  263. <Setter TargetName="contentPresenter" Property="Margin" Value="0" />
  264. </Trigger>
  265. </ControlTemplate.Triggers>
  266. </ControlTemplate>
  267. </Setter.Value>
  268. </Setter>
  269. </Style>
  270. <Style x:Key="DotLoading" TargetType="{x:Type bpa:Loading}">
  271. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  272. <Setter Property="FocusedBrush" Value="{DynamicResource Primary}" />
  273. <Setter Property="Diameter">
  274. <Setter.Value>
  275. <MultiBinding Converter="{StaticResource MathAddConverter}">
  276. <Binding Path="FontSize" RelativeSource="{RelativeSource Self}" />
  277. <Binding Source="20" />
  278. </MultiBinding>
  279. </Setter.Value>
  280. </Setter>
  281. <Setter Property="Template">
  282. <Setter.Value>
  283. <ControlTemplate TargetType="{x:Type bpa:Loading}">
  284. <Grid x:Name="root">
  285. <Grid.RowDefinitions>
  286. <RowDefinition Height="*" />
  287. <RowDefinition Height="Auto" />
  288. </Grid.RowDefinitions>
  289. <bpa:Icon Width="{TemplateBinding Diameter}"
  290. Height="{TemplateBinding Diameter}"
  291. Foreground="{TemplateBinding FocusedBrush}"
  292. RenderTransformOrigin="0.5 0.5"
  293. Type="Loader2Fill">
  294. <bpa:Icon.RenderTransform>
  295. <RotateTransform x:Name="angle" Angle="0" />
  296. </bpa:Icon.RenderTransform>
  297. </bpa:Icon>
  298. <ContentPresenter x:Name="contentPresenter"
  299. Grid.Row="1"
  300. Margin="0 5 0 0"
  301. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  302. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  303. Focusable="False"
  304. RecognizesAccessKey="True"
  305. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  306. </Grid>
  307. <ControlTemplate.Triggers>
  308. <Trigger Property="IsEnabled" Value="False">
  309. <Setter Property="Opacity" Value="{DynamicResource UnenableOpcity}" />
  310. </Trigger>
  311. <Trigger Property="IsEnabled" Value="True">
  312. <Trigger.EnterActions>
  313. <BeginStoryboard>
  314. <Storyboard RepeatBehavior="Forever">
  315. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="angle" Storyboard.TargetProperty="Angle">
  316. <EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="360" />
  317. </DoubleAnimationUsingKeyFrames>
  318. </Storyboard>
  319. </BeginStoryboard>
  320. </Trigger.EnterActions>
  321. <Trigger.ExitActions>
  322. <BeginStoryboard>
  323. <Storyboard RepeatBehavior="Forever">
  324. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="angle" Storyboard.TargetProperty="Angle">
  325. <EasingDoubleKeyFrame KeyTime="0:0:0" Value="0" />
  326. </DoubleAnimationUsingKeyFrames>
  327. </Storyboard>
  328. </BeginStoryboard>
  329. </Trigger.ExitActions>
  330. </Trigger>
  331. <Trigger Property="Content" Value="{x:Null}">
  332. <Setter TargetName="contentPresenter" Property="Margin" Value="0" />
  333. </Trigger>
  334. </ControlTemplate.Triggers>
  335. </ControlTemplate>
  336. </Setter.Value>
  337. </Setter>
  338. </Style>
  339. </ResourceDictionary>