Advertisement
FrayxRulez

Skype ProgressRingStyle

Sep 16th, 2016
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 11.63 KB | None | 0 0
  1. <Style x:Key="ProgressRingStyle" TargetType="ProgressRing">
  2.     <Setter Property="Background" Value="#00FFFFFF" />
  3.     <Setter Property="Foreground" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
  4.     <Setter Property="IsHitTestVisible" Value="False" />
  5.     <Setter Property="HorizontalAlignment" Value="Center" />
  6.     <Setter Property="VerticalAlignment" Value="Center" />
  7.     <Setter Property="MinHeight" Value="24" />
  8.     <Setter Property="MinWidth" Value="24" />
  9.     <Setter Property="IsTabStop" Value="False" />
  10.     <Setter Property="Template">
  11.         <Setter.Value>
  12.             <ControlTemplate TargetType="ProgressRing">
  13.                 <Grid x:Name="Ring"
  14.                     Padding="{TemplateBinding Padding}"
  15.                     Background="{TemplateBinding Background}"
  16.                     BorderBrush="{TemplateBinding BorderBrush}"
  17.                     BorderThickness="{TemplateBinding BorderThickness}"
  18.                     FlowDirection="LeftToRight"
  19.                     RenderTransformOrigin="0.5,0.5"
  20.                     Visibility="Collapsed">
  21.                     <Grid.MaxWidth>
  22.                         <Binding Path="TemplateSettings.MaxSideLength">
  23.                             <Binding.RelativeSource>
  24.                                 <RelativeSource Mode="TemplatedParent" />
  25.                             </Binding.RelativeSource>
  26.                         </Binding>
  27.                     </Grid.MaxWidth>
  28.                     <Grid.MaxHeight>
  29.                         <Binding Path="TemplateSettings.MaxSideLength">
  30.                             <Binding.RelativeSource>
  31.                                 <RelativeSource Mode="TemplatedParent" />
  32.                             </Binding.RelativeSource>
  33.                         </Binding>
  34.                     </Grid.MaxHeight>
  35.                     <Grid.Resources>
  36.                         <Style x:Key="ProgressRingEllipseStyle" TargetType="Ellipse">
  37.                             <Setter Property="Width" Value="6" />
  38.                             <Setter Property="Height" Value="6" />
  39.                             <Setter Property="HorizontalAlignment" Value="Center" />
  40.                             <Setter Property="VerticalAlignment" Value="Top" />
  41.                             <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
  42.                         </Style>
  43.                     </Grid.Resources>
  44.                     <VisualStateManager.VisualStateGroups>
  45.                         <VisualStateGroup x:Name="SizeStates">
  46.                             <VisualStateGroup.States>
  47.                                 <VisualState x:Name="Large" />
  48.                                 <VisualState x:Name="Small" />
  49.                             </VisualStateGroup.States>
  50.                         </VisualStateGroup>
  51.                         <VisualStateGroup x:Name="ActiveStates">
  52.                             <VisualState x:Name="Inactive" />
  53.                             <VisualState x:Name="Active">
  54.                                 <Storyboard RepeatBehavior="Forever">
  55.                                     <ObjectAnimationUsingKeyFrames Duration="0" TargetName="Ring" TargetProperty="Visibility">
  56.                                         <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
  57.                                     </ObjectAnimationUsingKeyFrames>
  58.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse01_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
  59.                                         <EasingDoubleKeyFrame KeyTime="0" Value="1" />
  60.                                         <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.47" Value="0.6" />
  61.                                         <SplineDoubleKeyFrame KeySpline="0.33,0,1,1" KeyTime="0:0:0.73" Value="0.7" />
  62.                                         <SplineDoubleKeyFrame KeySpline="0.8,0,0.78,1" KeyTime="0:0:1.02" Value="1.1" />
  63.                                         <SplineDoubleKeyFrame KeySpline="0.33,0,0,1" KeyTime="0:0:1.4" Value="1" />
  64.                                     </DoubleAnimationUsingKeyFrames>
  65.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse01_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
  66.                                         <EasingDoubleKeyFrame KeyTime="0" Value="1" />
  67.                                         <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.47" Value="0.6" />
  68.                                         <SplineDoubleKeyFrame KeySpline="0.33,0,1,1" KeyTime="0:0:0.73" Value="0.7" />
  69.                                         <SplineDoubleKeyFrame KeySpline="0.8,0,0.78,1" KeyTime="0:0:1.02" Value="1.1" />
  70.                                         <SplineDoubleKeyFrame KeySpline="0.33,0,0,1" KeyTime="0:0:1.4" Value="1" />
  71.                                     </DoubleAnimationUsingKeyFrames>
  72.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse01Grid_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)">
  73.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  74.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0" />
  75.                                             <SplineDoubleKeyFrame KeySpline="0.65,0.21,0.25,0.76" KeyTime="0:0:1.4" Value="360" />
  76.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  77.                                     </DoubleAnimationUsingKeyFrames>
  78.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse02_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
  79.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  80.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0.8" />
  81.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.07" Value="1" />
  82.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.53" Value="0.6" />
  83.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.8" Value="0.7" />
  84.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:1.02" Value="0.8" />
  85.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  86.                                     </DoubleAnimationUsingKeyFrames>
  87.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse02_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
  88.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  89.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0.8" />
  90.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.07" Value="1" />
  91.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.53" Value="0.6" />
  92.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.8" Value="0.7" />
  93.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:1.02" Value="0.8" />
  94.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  95.                                     </DoubleAnimationUsingKeyFrames>
  96.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse02Grid_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)">
  97.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  98.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0" />
  99.                                             <SplineDoubleKeyFrame KeySpline="0.76,0.21,0.25,0.76" KeyTime="0:0:1.4" Value="360" />
  100.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  101.                                     </DoubleAnimationUsingKeyFrames>
  102.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse03_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
  103.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  104.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0.8" />
  105.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.13" Value="1" />
  106.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.6" Value="0.6" />
  107.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.87" Value="0.7" />
  108.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:1.02" Value="0.8" />
  109.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  110.                                     </DoubleAnimationUsingKeyFrames>
  111.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse03_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
  112.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  113.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0.8" />
  114.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.13" Value="1" />
  115.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.6" Value="0.6" />
  116.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.87" Value="0.7" />
  117.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:1.02" Value="0.8" />
  118.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  119.                                     </DoubleAnimationUsingKeyFrames>
  120.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse03Grid_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)">
  121.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  122.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0" />
  123.                                             <SplineDoubleKeyFrame KeySpline="0.88,0.21,0.25,0.76" KeyTime="1,4" Value="360" />
  124.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  125.                                     </DoubleAnimationUsingKeyFrames>
  126.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse04_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)">
  127.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  128.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0.8" />
  129.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.2" Value="1" />
  130.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.67" Value="0.6" />
  131.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.93" Value="0.7" />
  132.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:1.02" Value="0.8" />
  133.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  134.                                     </DoubleAnimationUsingKeyFrames>
  135.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse04_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)">
  136.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  137.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0.8" />
  138.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.2" Value="1" />
  139.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.67" Value="0.6" />
  140.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:0.93" Value="0.7" />
  141.                                             <SplineDoubleKeyFrame KeySpline="0.33,0,0.67,1" KeyTime="0:0:1.02" Value="0.8" />
  142.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  143.                                     </DoubleAnimationUsingKeyFrames>
  144.                                     <DoubleAnimationUsingKeyFrames TargetName="Ellipse04Grid_S24" TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)">
  145.                                         <DoubleAnimationUsingKeyFrames.KeyFrames>
  146.                                             <EasingDoubleKeyFrame KeyTime="0" Value="0" />
  147.                                             <SplineDoubleKeyFrame KeySpline="1,0.2,0.25,0.76" KeyTime="1,4" Value="360" />
  148.                                         </DoubleAnimationUsingKeyFrames.KeyFrames>
  149.                                     </DoubleAnimationUsingKeyFrames>
  150.                                 </Storyboard>
  151.                             </VisualState>
  152.                         </VisualStateGroup>
  153.                     </VisualStateManager.VisualStateGroups>
  154.                     <Grid x:Name="Spinner_24x24" Width="24" Height="24" HorizontalAlignment="Center" VerticalAlignment="Center">
  155.                         <Grid x:Name="Ellipse01Grid_S24" RenderTransformOrigin="0.5,0.5">
  156.                             <Grid.RenderTransform>
  157.                                 <CompositeTransform />
  158.                             </Grid.RenderTransform>
  159.                             <Ellipse x:Name="Ellipse01_S24" Style="{StaticResource ProgressRingEllipseStyle}" Fill="{TemplateBinding Foreground}">
  160.                                 <Ellipse.RenderTransform>
  161.                                     <CompositeTransform />
  162.                                 </Ellipse.RenderTransform>
  163.                             </Ellipse>
  164.                         </Grid>
  165.                         <Grid x:Name="Ellipse02Grid_S24" RenderTransformOrigin="0.5,0.5">
  166.                             <Grid.RenderTransform>
  167.                                 <CompositeTransform />
  168.                             </Grid.RenderTransform>
  169.                             <Ellipse x:Name="Ellipse02_S24" Style="{StaticResource ProgressRingEllipseStyle}" Fill="{TemplateBinding Foreground}">
  170.                                 <Ellipse.RenderTransform>
  171.                                     <CompositeTransform />
  172.                                 </Ellipse.RenderTransform>
  173.                             </Ellipse>
  174.                         </Grid>
  175.                         <Grid x:Name="Ellipse03Grid_S24" RenderTransformOrigin="0.5,0.5">
  176.                             <Grid.RenderTransform>
  177.                                 <CompositeTransform />
  178.                             </Grid.RenderTransform>
  179.                             <Ellipse x:Name="Ellipse03_S24" Style="{StaticResource ProgressRingEllipseStyle}" Fill="{TemplateBinding Foreground}">
  180.                                 <Ellipse.RenderTransform>
  181.                                     <CompositeTransform />
  182.                                 </Ellipse.RenderTransform>
  183.                             </Ellipse>
  184.                         </Grid>
  185.                         <Grid x:Name="Ellipse04Grid_S24" RenderTransformOrigin="0.5,0.5">
  186.                             <Grid.RenderTransform>
  187.                                 <CompositeTransform />
  188.                             </Grid.RenderTransform>
  189.                             <Ellipse x:Name="Ellipse04_S24" Style="{StaticResource ProgressRingEllipseStyle}" Fill="{TemplateBinding Foreground}">
  190.                                 <Ellipse.RenderTransform>
  191.                                     <CompositeTransform />
  192.                                 </Ellipse.RenderTransform>
  193.                             </Ellipse>
  194.                         </Grid>
  195.                     </Grid>
  196.                 </Grid>
  197.             </ControlTemplate>
  198.         </Setter.Value>
  199.     </Setter>
  200. </Style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement