LoadingView.xaml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <Window x:Class="LampInspectionMachine.Views.LoadingView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:LampInspectionMachine.Views"
  7. mc:Ignorable="d"
  8. WindowStartupLocation="CenterScreen"
  9. WindowStyle="None"
  10. ResizeMode="NoResize"
  11. Width="300"
  12. Height="100"
  13. d:DesignHeight="150"
  14. d:DesignWidth="300"
  15. Background="Transparent"
  16. Title="LoadingView">
  17. <Window.Resources>
  18. <Style x:Key="ellipse"
  19. TargetType="Ellipse">
  20. <Setter Property="Width"
  21. Value="20" />
  22. <Setter Property="Height"
  23. Value="20" />
  24. <Setter Property="Fill"
  25. Value="#41b6e6" />
  26. <Setter Property="RenderTransform">
  27. <Setter.Value>
  28. <TranslateTransform X="0"
  29. Y="0" />
  30. </Setter.Value>
  31. </Setter>
  32. </Style>
  33. <PowerEase x:Key="powerEase"
  34. Power="2"
  35. EasingMode="EaseInOut" />
  36. </Window.Resources>
  37. <Canvas Background="Transparent"
  38. Width="200"
  39. Height="200">
  40. <Canvas.Triggers>
  41. <EventTrigger RoutedEvent="Loaded">
  42. <BeginStoryboard>
  43. <Storyboard RepeatBehavior="Forever"
  44. Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)">
  45. <DoubleAnimation Storyboard.TargetName="e1"
  46. To="-50"
  47. BeginTime="0:0:0.0"
  48. Duration="0:0:0.5"
  49. AutoReverse="True"
  50. EasingFunction="{StaticResource powerEase}" />
  51. <DoubleAnimation Storyboard.TargetName="e2"
  52. To="-50"
  53. BeginTime="0:0:0.1"
  54. Duration="0:0:0.5"
  55. AutoReverse="True"
  56. EasingFunction="{StaticResource powerEase}" />
  57. <DoubleAnimation Storyboard.TargetName="e3"
  58. To="-50"
  59. BeginTime="0:0:0.2"
  60. Duration="0:0:0.5"
  61. AutoReverse="True"
  62. EasingFunction="{StaticResource powerEase}" />
  63. <DoubleAnimation Storyboard.TargetName="e4"
  64. To="-50"
  65. BeginTime="0:0:0.3"
  66. Duration="0:0:0.5"
  67. AutoReverse="True"
  68. EasingFunction="{StaticResource powerEase}" />
  69. <DoubleAnimation Storyboard.TargetName="e5"
  70. To="-50"
  71. BeginTime="0:0:0.4"
  72. Duration="0:0:0.5"
  73. AutoReverse="True"
  74. EasingFunction="{StaticResource powerEase}" />
  75. </Storyboard>
  76. </BeginStoryboard>
  77. </EventTrigger>
  78. </Canvas.Triggers>
  79. <Label Content="Loading"
  80. Name="Msg"
  81. FontSize="16"
  82. FontFamily="Times New Roman"
  83. Foreground="#ffb549"
  84. FontWeight="Bold"
  85. Width="200"
  86. HorizontalContentAlignment="Center"
  87. Canvas.Top="70" />
  88. <Ellipse Name="e1"
  89. Canvas.Left="30"
  90. Canvas.Top="60"
  91. Style="{StaticResource ellipse}" />
  92. <Ellipse Name="e2"
  93. Canvas.Left="60"
  94. Canvas.Top="60"
  95. Style="{StaticResource ellipse}" />
  96. <Ellipse Name="e3"
  97. Canvas.Left="90"
  98. Canvas.Top="60"
  99. Style="{StaticResource ellipse}" />
  100. <Ellipse Name="e4"
  101. Canvas.Left="120"
  102. Canvas.Top="60"
  103. Style="{StaticResource ellipse}" />
  104. <Ellipse Name="e5"
  105. Canvas.Left="150"
  106. Canvas.Top="60"
  107. Style="{StaticResource ellipse}" />
  108. </Canvas>
  109. </Window>