Advertisement
FrayxRulez

Xbox One ProgressRingStyle

Sep 12th, 2016
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 18.11 KB | None | 0 0
  1. <Page
  2.    x:Class="Fuffa.MainPage"
  3.    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4.    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5.    xmlns:local="using:Fuffa"
  6.    xmlns:controls="using:Fuffa.Controls"
  7.    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8.    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9.    mc:Ignorable="d">
  10.  
  11.     <Page.Resources>
  12.         <SolidColorBrush x:Key="PrimaryUserColor" Color="#107C10" />
  13.         <SolidColorBrush x:Key="SecondaryUserColor" Color="#102B14" />
  14.         <SolidColorBrush x:Key="TertiaryUserColor" Color="#155715" />
  15.         <SolidColorBrush x:Key="ForegroundColor" Color="#FFFFFFFF" />
  16.        
  17.         <x:Double x:Key="OutsideRadius">212</x:Double>
  18.         <x:Double x:Key="InsideRadius">196</x:Double>
  19.        
  20.         <ExponentialEase x:Key="Exponent4" EasingMode="EaseInOut" Exponent="4" />
  21.  
  22.         <Style x:Key="ProgressRingStyle" TargetType="ProgressRing">
  23.             <Setter Property="Foreground" Value="{ThemeResource ForegroundColor}" />
  24.             <Setter Property="Height" Value="84" />
  25.             <Setter Property="VerticalAlignment" Value="Center" />
  26.             <Setter Property="HorizontalAlignment" Value="Center" />
  27.             <Setter Property="IsHitTestVisible" Value="False" />
  28.             <Setter Property="IsTabStop" Value="False" />
  29.             <Setter Property="MinHeight" Value="20" />
  30.             <Setter Property="MinWidth" Value="20" />
  31.             <Setter Property="Template">
  32.                 <Setter.Value>
  33.                     <ControlTemplate TargetType="ProgressRing">
  34.                         <Grid x:Name="RootGrid" Opacity="0">
  35.                             <VisualStateManager.VisualStateGroups>
  36.                                 <VisualStateGroup x:Name="ActiveStates">
  37.                                     <VisualState x:Name="Inactive" />
  38.                                     <VisualState x:Name="Active">
  39.                                         <Storyboard SpeedRatio="1.5">
  40.                                             <DoubleAnimation
  41.                                                BeginTime="0:0:1.6"
  42.                                                Duration="0:0:0.1"
  43.                                                From="0"
  44.                                                Storyboard.TargetName="RootGrid"
  45.                                                Storyboard.TargetProperty="(UIElement.Opacity)"
  46.                                                To="1" />
  47.                                             <DoubleAnimationUsingKeyFrames Duration="0:0:1.6" RepeatBehavior="Forever" Storyboard.TargetName="size1Rotate" Storyboard.TargetProperty="Angle">
  48.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0" Value="5" />
  49.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0:0:1.6" Value="355" />
  50.                                             </DoubleAnimationUsingKeyFrames>
  51.                                             <DoubleAnimationUsingKeyFrames Duration="0:0:1.6" RepeatBehavior="Forever" Storyboard.TargetName="postion1Rotate" Storyboard.TargetProperty="Angle">
  52.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0" Value="-5" />
  53.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0:0:1.6" Value="180" />
  54.                                             </DoubleAnimationUsingKeyFrames>
  55.                                             <DoubleAnimationUsingKeyFrames
  56.                                                BeginTime="0:0:0.1"
  57.                                                Duration="0:0:1.6"
  58.                                                RepeatBehavior="Forever"
  59.                                                Storyboard.TargetName="size2Rotate"
  60.                                                Storyboard.TargetProperty="Angle">
  61.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0" Value="0" />
  62.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0:0:1.5" Value="355" />
  63.                                             </DoubleAnimationUsingKeyFrames>
  64.                                             <DoubleAnimationUsingKeyFrames
  65.                                                BeginTime="0:0:0.1"
  66.                                                Duration="0:0:1.6"
  67.                                                RepeatBehavior="Forever"
  68.                                                Storyboard.TargetName="postion2Rotate"
  69.                                                Storyboard.TargetProperty="Angle">
  70.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0" Value="0" />
  71.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0:0:1.5" Value="180" />
  72.                                             </DoubleAnimationUsingKeyFrames>
  73.                                             <DoubleAnimationUsingKeyFrames
  74.                                                BeginTime="0:0:0.2"
  75.                                                Duration="0:0:1.6"
  76.                                                RepeatBehavior="Forever"
  77.                                                Storyboard.TargetName="size3Rotate"
  78.                                                Storyboard.TargetProperty="Angle">
  79.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0" Value="0" />
  80.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0:0:1.4" Value="355" />
  81.                                             </DoubleAnimationUsingKeyFrames>
  82.                                             <DoubleAnimationUsingKeyFrames
  83.                                                BeginTime="0:0:0.2"
  84.                                                Duration="0:0:1.6"
  85.                                                RepeatBehavior="Forever"
  86.                                                Storyboard.TargetName="postion3Rotate"
  87.                                                Storyboard.TargetProperty="Angle">
  88.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0" Value="0" />
  89.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0:0:1.4" Value="180" />
  90.                                             </DoubleAnimationUsingKeyFrames>
  91.                                             <DoubleAnimationUsingKeyFrames
  92.                                                BeginTime="0:0:0.3"
  93.                                                Duration="0:0:1.6"
  94.                                                RepeatBehavior="Forever"
  95.                                                Storyboard.TargetName="size4Rotate"
  96.                                                Storyboard.TargetProperty="Angle">
  97.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0" Value="0" />
  98.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0:0:1.4" Value="355" />
  99.                                             </DoubleAnimationUsingKeyFrames>
  100.                                             <DoubleAnimationUsingKeyFrames
  101.                                                BeginTime="0:0:0.3"
  102.                                                Duration="0:0:1.6"
  103.                                                RepeatBehavior="Forever"
  104.                                                Storyboard.TargetName="postion4Rotate"
  105.                                                Storyboard.TargetProperty="Angle">
  106.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0" Value="0" />
  107.                                                 <EasingDoubleKeyFrame EasingFunction="{StaticResource Exponent4}" KeyTime="0:0:1.4" Value="180" />
  108.                                             </DoubleAnimationUsingKeyFrames>
  109.                                         </Storyboard>
  110.                                     </VisualState>
  111.                                 </VisualStateGroup>
  112.                             </VisualStateManager.VisualStateGroups>
  113.                             <Viewbox Stretch="Uniform">
  114.                                 <Grid>
  115.                                     <Grid>
  116.                                         <Grid.RenderTransform>
  117.                                             <RotateTransform x:Name="postion4Rotate" CenterX="{StaticResource OutsideRadius}" CenterY="{StaticResource OutsideRadius}" />
  118.                                         </Grid.RenderTransform>
  119.                                         <Grid>
  120.                                             <Grid.Clip>
  121.                                                 <RectangleGeometry Rect="212,0,212,424" />
  122.                                             </Grid.Clip>
  123.                                             <Path Fill="{StaticResource SecondaryUserColor}">
  124.                                                 <Path.Data>
  125.                                                     <GeometryGroup FillRule="EvenOdd">
  126.                                                         <GeometryGroup.Children>
  127.                                                             <EllipseGeometry Center="212,212" RadiusX="{StaticResource InsideRadius}" RadiusY="{StaticResource InsideRadius}" />
  128.                                                             <EllipseGeometry Center="212,212" RadiusX="{StaticResource OutsideRadius}" RadiusY="{StaticResource OutsideRadius}" />
  129.                                                         </GeometryGroup.Children>
  130.                                                     </GeometryGroup>
  131.                                                 </Path.Data>
  132.                                                 <Path.Clip>
  133.                                                     <RectangleGeometry Rect="0,0,212,424">
  134.                                                         <RectangleGeometry.Transform>
  135.                                                             <RotateTransform x:Name="size4Rotate" CenterX="{StaticResource OutsideRadius}" CenterY="{StaticResource OutsideRadius}" />
  136.                                                         </RectangleGeometry.Transform>
  137.                                                     </RectangleGeometry>
  138.                                                 </Path.Clip>
  139.                                             </Path>
  140.                                         </Grid>
  141.                                     </Grid>
  142.                                     <Grid>
  143.                                         <Grid.RenderTransform>
  144.                                             <RotateTransform x:Name="postion3Rotate" CenterX="{StaticResource OutsideRadius}" CenterY="{StaticResource OutsideRadius}" />
  145.                                         </Grid.RenderTransform>
  146.                                         <Grid>
  147.                                             <Grid.Clip>
  148.                                                 <RectangleGeometry Rect="212,0,212,424" />
  149.                                             </Grid.Clip>
  150.                                             <Path Fill="{StaticResource TertiaryUserColor}">
  151.                                                 <Path.Data>
  152.                                                     <GeometryGroup FillRule="EvenOdd">
  153.                                                         <GeometryGroup.Children>
  154.                                                             <EllipseGeometry Center="212,212" RadiusX="{StaticResource InsideRadius}" RadiusY="{StaticResource InsideRadius}" />
  155.                                                             <EllipseGeometry Center="212,212" RadiusX="{StaticResource OutsideRadius}" RadiusY="{StaticResource OutsideRadius}" />
  156.                                                         </GeometryGroup.Children>
  157.                                                     </GeometryGroup>
  158.                                                 </Path.Data>
  159.                                                 <Path.Clip>
  160.                                                     <RectangleGeometry Rect="0,0,212,424">
  161.                                                         <RectangleGeometry.Transform>
  162.                                                             <RotateTransform x:Name="size3Rotate" CenterX="{StaticResource OutsideRadius}" CenterY="{StaticResource OutsideRadius}" />
  163.                                                         </RectangleGeometry.Transform>
  164.                                                     </RectangleGeometry>
  165.                                                 </Path.Clip>
  166.                                             </Path>
  167.                                         </Grid>
  168.                                     </Grid>
  169.                                     <Grid>
  170.                                         <Grid.RenderTransform>
  171.                                             <RotateTransform x:Name="postion2Rotate" CenterX="{StaticResource OutsideRadius}" CenterY="{StaticResource OutsideRadius}" />
  172.                                         </Grid.RenderTransform>
  173.                                         <Grid>
  174.                                             <Grid.Clip>
  175.                                                 <RectangleGeometry Rect="212,0,212,424" />
  176.                                             </Grid.Clip>
  177.                                             <Path Fill="{StaticResource PrimaryUserColor}">
  178.                                                 <Path.Data>
  179.                                                     <GeometryGroup FillRule="EvenOdd">
  180.                                                         <GeometryGroup.Children>
  181.                                                             <EllipseGeometry Center="212,212" RadiusX="{StaticResource InsideRadius}" RadiusY="{StaticResource InsideRadius}" />
  182.                                                             <EllipseGeometry Center="212,212" RadiusX="{StaticResource OutsideRadius}" RadiusY="{StaticResource OutsideRadius}" />
  183.                                                         </GeometryGroup.Children>
  184.                                                     </GeometryGroup>
  185.                                                 </Path.Data>
  186.                                                 <Path.Clip>
  187.                                                     <RectangleGeometry Rect="0,0,212,424">
  188.                                                         <RectangleGeometry.Transform>
  189.                                                             <RotateTransform x:Name="size2Rotate" CenterX="{StaticResource OutsideRadius}" CenterY="{StaticResource OutsideRadius}" />
  190.                                                         </RectangleGeometry.Transform>
  191.                                                     </RectangleGeometry>
  192.                                                 </Path.Clip>
  193.                                             </Path>
  194.                                         </Grid>
  195.                                     </Grid>
  196.                                     <Grid>
  197.                                         <Grid.RenderTransform>
  198.                                             <RotateTransform x:Name="postion1Rotate" Angle="-5" CenterX="{StaticResource OutsideRadius}" CenterY="{StaticResource OutsideRadius}" />
  199.                                         </Grid.RenderTransform>
  200.                                         <Grid>
  201.                                             <Grid.Clip>
  202.                                                 <RectangleGeometry Rect="212,0,212,424" />
  203.                                             </Grid.Clip>
  204.                                             <Path Fill="{StaticResource ForegroundColor}">
  205.                                                 <Path.Data>
  206.                                                     <GeometryGroup FillRule="EvenOdd">
  207.                                                         <GeometryGroup.Children>
  208.                                                             <EllipseGeometry Center="212,212" RadiusX="{StaticResource InsideRadius}" RadiusY="{StaticResource InsideRadius}" />
  209.                                                             <EllipseGeometry Center="212,212" RadiusX="{StaticResource OutsideRadius}" RadiusY="{StaticResource OutsideRadius}" />
  210.                                                         </GeometryGroup.Children>
  211.                                                     </GeometryGroup>
  212.                                                 </Path.Data>
  213.                                                 <Path.Clip>
  214.                                                     <RectangleGeometry Rect="0,0,212,424">
  215.                                                         <RectangleGeometry.Transform>
  216.                                                             <RotateTransform x:Name="size1Rotate" CenterX="{StaticResource OutsideRadius}" CenterY="{StaticResource OutsideRadius}" />
  217.                                                         </RectangleGeometry.Transform>
  218.                                                     </RectangleGeometry>
  219.                                                 </Path.Clip>
  220.                                             </Path>
  221.                                         </Grid>
  222.                                     </Grid>
  223.                                 </Grid>
  224.                             </Viewbox>
  225.                         </Grid>
  226.                     </ControlTemplate>
  227.                 </Setter.Value>
  228.             </Setter>
  229.         </Style>
  230.     </Page.Resources>
  231.  
  232.     <Grid Background="#FF171717">
  233.         <ProgressRing IsActive="True" Width="100" Height="100" Style="{StaticResource ProgressRingStyle}"/>
  234.     </Grid>
  235. </Page>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement