BusyIndicator.xaml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <UserControl
  2. x:Class="MECF.Framework.UI.Client.ClientBase.UserControls.BusyIndicator"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:local="clr-namespace:MECF.Framework.UI.Client.CenterViews.DataLogs.Event"
  8. xmlns:userControls="clr-namespace:MECF.Framework.UI.Client.ClientBase.UserControls"
  9. d:DesignHeight="150"
  10. d:DesignWidth="230"
  11. mc:Ignorable="d">
  12. <UserControl.Resources>
  13. <Style TargetType="{x:Type userControls:CirclePointRingLoading}">
  14. <Setter Property="Foreground" Value="#FFFFFFFF" />
  15. <Setter Property="IsHitTestVisible" Value="False" />
  16. <Setter Property="HorizontalAlignment" Value="Center" />
  17. <Setter Property="VerticalAlignment" Value="Center" />
  18. <Setter Property="MinHeight" Value="20" />
  19. <Setter Property="MinWidth" Value="20" />
  20. <Setter Property="Height" Value="60" />
  21. <Setter Property="Width" Value="60" />
  22. <Setter Property="IsTabStop" Value="False" />
  23. <Setter Property="Template">
  24. <Setter.Value>
  25. <ControlTemplate TargetType="{x:Type userControls:CirclePointRingLoading}">
  26. <Border
  27. Background="{TemplateBinding Background}"
  28. BorderBrush="{TemplateBinding BorderBrush}"
  29. BorderThickness="{TemplateBinding BorderThickness}">
  30. <FrameworkElement.Resources>
  31. <ResourceDictionary>
  32. <Style x:Key="ProgressRingEllipseStyle" TargetType="{x:Type Ellipse}">
  33. <Setter Property="Opacity" Value="0" />
  34. <Setter Property="HorizontalAlignment" Value="Left" />
  35. <Setter Property="VerticalAlignment" Value="Top" />
  36. </Style>
  37. </ResourceDictionary>
  38. </FrameworkElement.Resources>
  39. <Grid
  40. Name="Ring"
  41. MaxWidth="{Binding MaxSideLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  42. MaxHeight="{Binding MaxSideLength, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  43. Margin="{TemplateBinding Padding}"
  44. FlowDirection="LeftToRight"
  45. RenderTransformOrigin=".5,.5"
  46. Visibility="Visible">
  47. <Canvas RenderTransformOrigin=".5,.5">
  48. <UIElement.RenderTransform>
  49. <RotateTransform x:Name="E1R" />
  50. </UIElement.RenderTransform>
  51. <Ellipse
  52. Name="E1"
  53. Width="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  54. Height="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  55. Margin="{Binding EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  56. Fill="{TemplateBinding Foreground}"
  57. Style="{StaticResource ProgressRingEllipseStyle}" />
  58. </Canvas>
  59. <Canvas RenderTransformOrigin=".5,.5">
  60. <UIElement.RenderTransform>
  61. <RotateTransform x:Name="E2R" />
  62. </UIElement.RenderTransform>
  63. <Ellipse
  64. Name="E2"
  65. Width="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  66. Height="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  67. Margin="{Binding EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  68. Fill="{TemplateBinding Foreground}"
  69. Style="{StaticResource ProgressRingEllipseStyle}" />
  70. </Canvas>
  71. <Canvas RenderTransformOrigin=".5,.5">
  72. <UIElement.RenderTransform>
  73. <RotateTransform x:Name="E3R" />
  74. </UIElement.RenderTransform>
  75. <Ellipse
  76. Name="E3"
  77. Width="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  78. Height="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  79. Margin="{Binding EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  80. Fill="{TemplateBinding Foreground}"
  81. Style="{StaticResource ProgressRingEllipseStyle}" />
  82. </Canvas>
  83. <Canvas RenderTransformOrigin=".5,.5">
  84. <UIElement.RenderTransform>
  85. <RotateTransform x:Name="E4R" />
  86. </UIElement.RenderTransform>
  87. <Ellipse
  88. Name="E4"
  89. Width="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  90. Height="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  91. Margin="{Binding EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  92. Fill="{TemplateBinding Foreground}"
  93. Style="{StaticResource ProgressRingEllipseStyle}" />
  94. </Canvas>
  95. <Canvas RenderTransformOrigin=".5,.5">
  96. <UIElement.RenderTransform>
  97. <RotateTransform x:Name="E5R" />
  98. </UIElement.RenderTransform>
  99. <Ellipse
  100. Name="E5"
  101. Width="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  102. Height="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  103. Margin="{Binding EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  104. Fill="{TemplateBinding Foreground}"
  105. Style="{StaticResource ProgressRingEllipseStyle}" />
  106. </Canvas>
  107. <Canvas
  108. Name="SixthCircle"
  109. RenderTransformOrigin=".5,.5"
  110. Visibility="Collapsed">
  111. <UIElement.RenderTransform>
  112. <RotateTransform x:Name="E6R" />
  113. </UIElement.RenderTransform>
  114. <Ellipse
  115. Name="E6"
  116. Width="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  117. Height="{Binding EllipseDiameter, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  118. Margin="{Binding EllipseOffset, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  119. Fill="{TemplateBinding Foreground}"
  120. Style="{StaticResource ProgressRingEllipseStyle}" />
  121. </Canvas>
  122. </Grid>
  123. <VisualStateManager.VisualStateGroups>
  124. <VisualStateGroup x:Name="SizeStates">
  125. <VisualState x:Name="Large">
  126. <Storyboard>
  127. <ObjectAnimationUsingKeyFrames
  128. Storyboard.TargetName="SixthCircle"
  129. Storyboard.TargetProperty="Visibility"
  130. Duration="0">
  131. <DiscreteObjectKeyFrame KeyTime="0">
  132. <ObjectKeyFrame.Value>
  133. <Visibility>Visible</Visibility>
  134. </ObjectKeyFrame.Value>
  135. </DiscreteObjectKeyFrame>
  136. </ObjectAnimationUsingKeyFrames>
  137. </Storyboard>
  138. </VisualState>
  139. <VisualState x:Name="Small" />
  140. </VisualStateGroup>
  141. <VisualStateGroup x:Name="ActiveStates">
  142. <VisualState x:Name="Inactive" />
  143. <VisualState x:Name="Active">
  144. <Storyboard RepeatBehavior="Forever">
  145. <ObjectAnimationUsingKeyFrames
  146. Storyboard.TargetName="Ring"
  147. Storyboard.TargetProperty="Visibility"
  148. Duration="0">
  149. <DiscreteObjectKeyFrame KeyTime="0">
  150. <ObjectKeyFrame.Value>
  151. <Visibility>Visible</Visibility>
  152. </ObjectKeyFrame.Value>
  153. </DiscreteObjectKeyFrame>
  154. </ObjectAnimationUsingKeyFrames>
  155. <DoubleAnimationUsingKeyFrames
  156. BeginTime="0"
  157. Storyboard.TargetName="E1"
  158. Storyboard.TargetProperty="Opacity">
  159. <DiscreteDoubleKeyFrame KeyTime="0" Value="1" />
  160. <DiscreteDoubleKeyFrame KeyTime="0:0:3.21" Value="1" />
  161. <DiscreteDoubleKeyFrame KeyTime="0:0:3.22" Value="0" />
  162. <DiscreteDoubleKeyFrame KeyTime="0:0:3.47" Value="0" />
  163. </DoubleAnimationUsingKeyFrames>
  164. <DoubleAnimationUsingKeyFrames
  165. BeginTime="00:00:00.167"
  166. Storyboard.TargetName="E2"
  167. Storyboard.TargetProperty="Opacity">
  168. <DiscreteDoubleKeyFrame KeyTime="0" Value="1" />
  169. <DiscreteDoubleKeyFrame KeyTime="0:0:3.21" Value="1" />
  170. <DiscreteDoubleKeyFrame KeyTime="0:0:3.22" Value="0" />
  171. <DiscreteDoubleKeyFrame KeyTime="0:0:3.47" Value="0" />
  172. </DoubleAnimationUsingKeyFrames>
  173. <DoubleAnimationUsingKeyFrames
  174. BeginTime="00:00:00.334"
  175. Storyboard.TargetName="E3"
  176. Storyboard.TargetProperty="Opacity">
  177. <DiscreteDoubleKeyFrame KeyTime="0" Value="1" />
  178. <DiscreteDoubleKeyFrame KeyTime="0:0:3.21" Value="1" />
  179. <DiscreteDoubleKeyFrame KeyTime="0:0:3.22" Value="0" />
  180. <DiscreteDoubleKeyFrame KeyTime="0:0:3.47" Value="0" />
  181. </DoubleAnimationUsingKeyFrames>
  182. <DoubleAnimationUsingKeyFrames
  183. BeginTime="00:00:00.501"
  184. Storyboard.TargetName="E4"
  185. Storyboard.TargetProperty="Opacity">
  186. <DiscreteDoubleKeyFrame KeyTime="0" Value="1" />
  187. <DiscreteDoubleKeyFrame KeyTime="0:0:3.21" Value="1" />
  188. <DiscreteDoubleKeyFrame KeyTime="0:0:3.22" Value="0" />
  189. <DiscreteDoubleKeyFrame KeyTime="0:0:3.47" Value="0" />
  190. </DoubleAnimationUsingKeyFrames>
  191. <DoubleAnimationUsingKeyFrames
  192. BeginTime="00:00:00.668"
  193. Storyboard.TargetName="E5"
  194. Storyboard.TargetProperty="Opacity">
  195. <DiscreteDoubleKeyFrame KeyTime="0" Value="1" />
  196. <DiscreteDoubleKeyFrame KeyTime="0:0:3.21" Value="1" />
  197. <DiscreteDoubleKeyFrame KeyTime="0:0:3.22" Value="0" />
  198. <DiscreteDoubleKeyFrame KeyTime="0:0:3.47" Value="0" />
  199. </DoubleAnimationUsingKeyFrames>
  200. <DoubleAnimationUsingKeyFrames
  201. BeginTime="00:00:00.835"
  202. Storyboard.TargetName="E6"
  203. Storyboard.TargetProperty="Opacity">
  204. <DiscreteDoubleKeyFrame KeyTime="0" Value="1" />
  205. <DiscreteDoubleKeyFrame KeyTime="0:0:3.21" Value="1" />
  206. <DiscreteDoubleKeyFrame KeyTime="0:0:3.22" Value="0" />
  207. <DiscreteDoubleKeyFrame KeyTime="0:0:3.47" Value="0" />
  208. </DoubleAnimationUsingKeyFrames>
  209. <DoubleAnimationUsingKeyFrames
  210. BeginTime="0"
  211. Storyboard.TargetName="E1R"
  212. Storyboard.TargetProperty="Angle">
  213. <SplineDoubleKeyFrame
  214. KeySpline="0.13,0.21,0.1,0.7"
  215. KeyTime="0"
  216. Value="-110" />
  217. <SplineDoubleKeyFrame
  218. KeySpline="0.02,0.33,0.38,0.77"
  219. KeyTime="0:0:0.433"
  220. Value="10" />
  221. <SplineDoubleKeyFrame KeyTime="0:0:1.2" Value="93" />
  222. <SplineDoubleKeyFrame
  223. KeySpline="0.57,0.17,0.95,0.75"
  224. KeyTime="0:0:1.617"
  225. Value="205" />
  226. <SplineDoubleKeyFrame
  227. KeySpline="0,0.19,0.07,0.72"
  228. KeyTime="0:0:2.017"
  229. Value="357" />
  230. <SplineDoubleKeyFrame KeyTime="0:0:2.783" Value="439" />
  231. <SplineDoubleKeyFrame
  232. KeySpline="0,0,0.95,0.37"
  233. KeyTime="0:0:3.217"
  234. Value="585" />
  235. </DoubleAnimationUsingKeyFrames>
  236. <DoubleAnimationUsingKeyFrames
  237. BeginTime="00:00:00.167"
  238. Storyboard.TargetName="E2R"
  239. Storyboard.TargetProperty="Angle">
  240. <SplineDoubleKeyFrame
  241. KeySpline="0.13,0.21,0.1,0.7"
  242. KeyTime="0"
  243. Value="-116" />
  244. <SplineDoubleKeyFrame
  245. KeySpline="0.02,0.33,0.38,0.77"
  246. KeyTime="0:0:0.433"
  247. Value="4" />
  248. <SplineDoubleKeyFrame KeyTime="0:0:1.2" Value="87" />
  249. <SplineDoubleKeyFrame
  250. KeySpline="0.57,0.17,0.95,0.75"
  251. KeyTime="0:0:1.617"
  252. Value="199" />
  253. <SplineDoubleKeyFrame
  254. KeySpline="0,0.19,0.07,0.72"
  255. KeyTime="0:0:2.017"
  256. Value="351" />
  257. <SplineDoubleKeyFrame KeyTime="0:0:2.783" Value="433" />
  258. <SplineDoubleKeyFrame
  259. KeySpline="0,0,0.95,0.37"
  260. KeyTime="0:0:3.217"
  261. Value="579" />
  262. </DoubleAnimationUsingKeyFrames>
  263. <DoubleAnimationUsingKeyFrames
  264. BeginTime="00:00:00.334"
  265. Storyboard.TargetName="E3R"
  266. Storyboard.TargetProperty="Angle">
  267. <SplineDoubleKeyFrame
  268. KeySpline="0.13,0.21,0.1,0.7"
  269. KeyTime="0"
  270. Value="-122" />
  271. <SplineDoubleKeyFrame
  272. KeySpline="0.02,0.33,0.38,0.77"
  273. KeyTime="0:0:0.433"
  274. Value="-2" />
  275. <SplineDoubleKeyFrame KeyTime="0:0:1.2" Value="81" />
  276. <SplineDoubleKeyFrame
  277. KeySpline="0.57,0.17,0.95,0.75"
  278. KeyTime="0:0:1.617"
  279. Value="193" />
  280. <SplineDoubleKeyFrame
  281. KeySpline="0,0.19,0.07,0.72"
  282. KeyTime="0:0:2.017"
  283. Value="345" />
  284. <SplineDoubleKeyFrame KeyTime="0:0:2.783" Value="427" />
  285. <SplineDoubleKeyFrame
  286. KeySpline="0,0,0.95,0.37"
  287. KeyTime="0:0:3.217"
  288. Value="573" />
  289. </DoubleAnimationUsingKeyFrames>
  290. <DoubleAnimationUsingKeyFrames
  291. BeginTime="00:00:00.501"
  292. Storyboard.TargetName="E4R"
  293. Storyboard.TargetProperty="Angle">
  294. <SplineDoubleKeyFrame
  295. KeySpline="0.13,0.21,0.1,0.7"
  296. KeyTime="0"
  297. Value="-128" />
  298. <SplineDoubleKeyFrame
  299. KeySpline="0.02,0.33,0.38,0.77"
  300. KeyTime="0:0:0.433"
  301. Value="-8" />
  302. <SplineDoubleKeyFrame KeyTime="0:0:1.2" Value="75" />
  303. <SplineDoubleKeyFrame
  304. KeySpline="0.57,0.17,0.95,0.75"
  305. KeyTime="0:0:1.617"
  306. Value="187" />
  307. <SplineDoubleKeyFrame
  308. KeySpline="0,0.19,0.07,0.72"
  309. KeyTime="0:0:2.017"
  310. Value="339" />
  311. <SplineDoubleKeyFrame KeyTime="0:0:2.783" Value="421" />
  312. <SplineDoubleKeyFrame
  313. KeySpline="0,0,0.95,0.37"
  314. KeyTime="0:0:3.217"
  315. Value="567" />
  316. </DoubleAnimationUsingKeyFrames>
  317. <DoubleAnimationUsingKeyFrames
  318. BeginTime="00:00:00.668"
  319. Storyboard.TargetName="E5R"
  320. Storyboard.TargetProperty="Angle">
  321. <SplineDoubleKeyFrame
  322. KeySpline="0.13,0.21,0.1,0.7"
  323. KeyTime="0"
  324. Value="-134" />
  325. <SplineDoubleKeyFrame
  326. KeySpline="0.02,0.33,0.38,0.77"
  327. KeyTime="0:0:0.433"
  328. Value="-14" />
  329. <SplineDoubleKeyFrame KeyTime="0:0:1.2" Value="69" />
  330. <SplineDoubleKeyFrame
  331. KeySpline="0.57,0.17,0.95,0.75"
  332. KeyTime="0:0:1.617"
  333. Value="181" />
  334. <SplineDoubleKeyFrame
  335. KeySpline="0,0.19,0.07,0.72"
  336. KeyTime="0:0:2.017"
  337. Value="331" />
  338. <SplineDoubleKeyFrame KeyTime="0:0:2.783" Value="415" />
  339. <SplineDoubleKeyFrame
  340. KeySpline="0,0,0.95,0.37"
  341. KeyTime="0:0:3.217"
  342. Value="561" />
  343. </DoubleAnimationUsingKeyFrames>
  344. <DoubleAnimationUsingKeyFrames
  345. BeginTime="00:00:00.835"
  346. Storyboard.TargetName="E6R"
  347. Storyboard.TargetProperty="Angle">
  348. <SplineDoubleKeyFrame
  349. KeySpline="0.13,0.21,0.1,0.7"
  350. KeyTime="0"
  351. Value="-140" />
  352. <SplineDoubleKeyFrame
  353. KeySpline="0.02,0.33,0.38,0.77"
  354. KeyTime="0:0:0.433"
  355. Value="-20" />
  356. <SplineDoubleKeyFrame KeyTime="0:0:1.2" Value="63" />
  357. <SplineDoubleKeyFrame
  358. KeySpline="0.57,0.17,0.95,0.75"
  359. KeyTime="0:0:1.617"
  360. Value="175" />
  361. <SplineDoubleKeyFrame
  362. KeySpline="0,0.19,0.07,0.72"
  363. KeyTime="0:0:2.017"
  364. Value="325" />
  365. <SplineDoubleKeyFrame KeyTime="0:0:2.783" Value="409" />
  366. <SplineDoubleKeyFrame
  367. KeySpline="0,0,0.95,0.37"
  368. KeyTime="0:0:3.217"
  369. Value="555" />
  370. </DoubleAnimationUsingKeyFrames>
  371. </Storyboard>
  372. </VisualState>
  373. </VisualStateGroup>
  374. </VisualStateManager.VisualStateGroups>
  375. </Border>
  376. </ControlTemplate>
  377. </Setter.Value>
  378. </Setter>
  379. </Style>
  380. </UserControl.Resources>
  381. <Border>
  382. <Grid>
  383. <Grid.RowDefinitions>
  384. <RowDefinition />
  385. <RowDefinition />
  386. </Grid.RowDefinitions>
  387. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  388. <userControls:CirclePointRingLoading
  389. Width="20"
  390. Height="20"
  391. HorizontalAlignment="Left"
  392. EllipseDiameter="3"
  393. Foreground="#3ca9fe"
  394. IsActive="True"
  395. IsLarge="True"
  396. Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=Visibility}" />
  397. <StackPanel>
  398. <TextBlock
  399. Margin="10,0,0,0"
  400. HorizontalAlignment="Left"
  401. VerticalAlignment="Center"
  402. FontSize="10"
  403. Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=Message}" />
  404. </StackPanel>
  405. </StackPanel>
  406. <Button
  407. x:Name="btnCancel"
  408. Grid.Row="1"
  409. Width="80"
  410. Height="25"
  411. Margin="0,5,0,0"
  412. HorizontalAlignment="Center"
  413. VerticalAlignment="Top"
  414. Click="BtnCancel_OnClick"
  415. Content="Cancel"
  416. FontSize="8" />
  417. </Grid>
  418. </Border>
  419. </UserControl>