SingleRound.xaml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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="SingleRound"
  5. TargetType="{x:Type UI:Loading}">
  6. <Grid x:Name="PART_Root" Background="{TemplateBinding Background}">
  7. <Ellipse x:Name="PART_Ellipse"
  8. Fill="{TemplateBinding Foreground}"
  9. RenderTransformOrigin="0.5,0.5">
  10. <Ellipse.RenderTransform>
  11. <ScaleTransform />
  12. </Ellipse.RenderTransform>
  13. </Ellipse>
  14. <VisualStateManager.VisualStateGroups>
  15. <VisualStateGroup x:Name="ActiveStates">
  16. <VisualState x:Name="Inactive" />
  17. <VisualState x:Name="Active">
  18. <Storyboard Duration="0:0:1.500" RepeatBehavior="Forever"
  19. SpeedRatio="{TemplateBinding SpeedRatio}">
  20. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_Ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
  21. <LinearDoubleKeyFrame KeyTime="0:0:0.000" Value="0" />
  22. <LinearDoubleKeyFrame KeyTime="0:0:1.500" Value="1" />
  23. </DoubleAnimationUsingKeyFrames>
  24. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_Ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
  25. <LinearDoubleKeyFrame KeyTime="0:0:0.000" Value="0" />
  26. <LinearDoubleKeyFrame KeyTime="0:0:1.500" Value="1" />
  27. </DoubleAnimationUsingKeyFrames>
  28. <DoubleAnimation Duration="0:0:1.500" From="1" Storyboard.TargetName="PART_Ellipse" Storyboard.TargetProperty="(UIElement.Opacity)"
  29. To="0" />
  30. </Storyboard>
  31. </VisualState>
  32. </VisualStateGroup>
  33. </VisualStateManager.VisualStateGroups>
  34. </Grid>
  35. </ControlTemplate>
  36. </ResourceDictionary>