private async Task Rotate()

in MoleDeploy.UWPClient/MainPage.xaml.cs [176:209]


        private async Task Rotate(VstsBuildState state)
        {
            if (animationCancellationTokenSource != null)
            {
                animationCancellationTokenSource.Cancel();
            }

            animationCancellationTokenSource = new CancellationTokenSource();
            var cancellationToken = animationCancellationTokenSource.Token;

            var element = GetClipElementForState(state);

            Storyboard storyboard = new Storyboard();

            cancellationToken.Register(async () =>
            {
                await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    storyboard.RepeatBehavior = new RepeatBehavior(0);
                });
            });

            element.RenderTransform = new RotateTransform();

            DoubleAnimation rotateAnimation = BuildAnimation();


            Storyboard.SetTarget(rotateAnimation, element.RenderTransform);
            Storyboard.SetTargetProperty(rotateAnimation, "Angle");

            storyboard.Children.Add(rotateAnimation);

            await storyboard.BeginAsync();
        }