DoubleRound.xaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:UI="clr-namespace:CustomUI">
  4. <ControlTemplate x:Key="DoubleRound"
  5. TargetType="{x:Type UI:Loading}">
  6. <Grid x:Name="PART_Root" Background="{TemplateBinding Background}">
  7. <Ellipse x:Name="PART_Ellipse0"
  8. Fill="{TemplateBinding Foreground}"
  9. Opacity="0.5" RenderTransformOrigin="0.5,0.5">
  10. <Ellipse.RenderTransform>
  11. <ScaleTransform />
  12. </Ellipse.RenderTransform>
  13. </Ellipse>
  14. <Ellipse x:Name="PART_Ellipse1"
  15. Fill="{TemplateBinding Foreground}"
  16. Opacity="0.5" RenderTransformOrigin="0.5,0.5">
  17. <Ellipse.RenderTransform>
  18. <ScaleTransform ScaleX="0.5" ScaleY="0.5" />
  19. </Ellipse.RenderTransform>
  20. </Ellipse>
  21. <VisualStateManager.VisualStateGroups>
  22. <VisualStateGroup x:Name="ActiveStates">
  23. <VisualState x:Name="Inactive" />
  24. <VisualState x:Name="Active">
  25. <Storyboard Duration="0:0:1.000" RepeatBehavior="Forever"
  26. SpeedRatio="{TemplateBinding SpeedRatio}">
  27. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_Ellipse0" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
  28. <EasingDoubleKeyFrame KeyTime="0:0:0.000" Value="0" />
  29. <EasingDoubleKeyFrame KeyTime="0:0:1.000" Value="1" />
  30. </DoubleAnimationUsingKeyFrames>
  31. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_Ellipse0" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
  32. <EasingDoubleKeyFrame KeyTime="0:0:0.000" Value="0" />
  33. <EasingDoubleKeyFrame KeyTime="0:0:1.000" Value="1" />
  34. </DoubleAnimationUsingKeyFrames>
  35. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_Ellipse1" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
  36. <EasingDoubleKeyFrame KeyTime="0:0:0.000" Value="1" />
  37. <EasingDoubleKeyFrame KeyTime="0:0:1.000" Value="0" />
  38. </DoubleAnimationUsingKeyFrames>
  39. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_Ellipse1" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
  40. <EasingDoubleKeyFrame KeyTime="0:0:0.000" Value="1" />
  41. <EasingDoubleKeyFrame KeyTime="0:0:1.000" Value="0" />
  42. </DoubleAnimationUsingKeyFrames>
  43. </Storyboard>
  44. </VisualState>
  45. </VisualStateGroup>
  46. </VisualStateManager.VisualStateGroups>
  47. </Grid>
  48. </ControlTemplate>
  49. </ResourceDictionary>