Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4051094
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:09:07+00:00 2026-05-20T14:09:07+00:00

I have created a circular processing animation similar to the one seen on the

  • 0

I have created a circular processing animation similar to the one seen on the Chrome browser tab… i want to use it throughout my application and therefore decide to put it as a resource.. however.. i would like to know what is the best way/practice to use this animation resource easily in my app… below is the xaml code for my processing animation.
should it be used as a DataTemplate or ControlTemplate?

<Grid>
<Grid.Resources>
  <Storyboard x:Key="LoadingAnimation" RepeatBehavior="Forever">
  <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(c:Arc.EndAngle)" Storyboard.TargetName="arc">
    <EasingDoubleKeyFrame KeyTime="0" Value="90"/>
    <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="-90"/>
    <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="-270"/>
  </DoubleAnimationUsingKeyFrames>
  <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(c:Arc.StartAngle)" Storyboard.TargetName="arc">
    <EasingDoubleKeyFrame KeyTime="0" Value="-90"/>
    <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="-270"/>
    <EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="-450"/>
  </DoubleAnimationUsingKeyFrames>
</Storyboard>
</Grid.Resources>
<Grid.Triggers>
  <EventTrigger RoutedEvent="FrameworkElement.Loaded">
  <BeginStoryboard Storyboard="{StaticResource LoadingAnimation}"/>
</EventTrigger>
</Grid.Triggers>

<c:Arc x:Name="arcbackground" StartAngle="0" EndAngle="359.9"  Stroke="#FFE0E0E0"  StrokeThickness="8"/>
<c:Arc x:Name="arc" Stroke="{StaticResource BlueGradientBrush}"  StrokeThickness="8"/>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:09:07+00:00Added an answer on May 20, 2026 at 2:09 pm

    I needed something similar a couple of days ago. I put the storyboard and the elements to be animated in a user control. I added a dependency property to be able to start/stop the animation through biding. All that’s left is to use the user control wherever you need it in your application.

    My XAML looks like this:

    <UserControl x:Class="MyAssembly.SpinningWait"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       xmlns:core="clr-namespace:MyAssembly">
        <UserControl.Resources>
            <Storyboard x:Key="canvasAnimation">
                <DoubleAnimationUsingKeyFrames
                   RepeatBehavior="Forever"
                   SpeedRatio="24"
                   Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)"
                   Storyboard.TargetName="canvas">
                    <DiscreteDoubleKeyFrame KeyTime="0:0:2" Value="45"/>
                    <DiscreteDoubleKeyFrame KeyTime="0:0:4" Value="90"/>
                    <DiscreteDoubleKeyFrame KeyTime="0:0:6" Value="135"/>
                    <DiscreteDoubleKeyFrame KeyTime="0:0:8" Value="180"/>
                    <DiscreteDoubleKeyFrame KeyTime="0:0:10" Value="225"/>
                    <DiscreteDoubleKeyFrame KeyTime="0:0:12" Value="270"/>
                    <DiscreteDoubleKeyFrame KeyTime="0:0:14" Value="315"/>
                    <DiscreteDoubleKeyFrame KeyTime="0:0:16" Value="360"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </UserControl.Resources>
    
        <core:RadialPanel x:Name="canvas" RenderTransformOrigin="0.5,0.5">
            <core:RadialPanel.Resources>
                <Style TargetType="Ellipse">
                    <Setter Property="Height" Value="6" />
                    <Setter Property="Width" Value="6" />
                    <Setter Property="Fill" Value="White" />
                </Style>
            </core:RadialPanel.Resources>
    
            <core:RadialPanel.RenderTransform>
                <TransformGroup>
                    <RotateTransform/>
                </TransformGroup>
            </core:RadialPanel.RenderTransform>
    
            <Ellipse />
            <Ellipse Opacity="0.1" />
            <Ellipse Opacity="0.2" />
            <Ellipse Opacity="0.3" />
            <Ellipse Opacity="0.4" />
            <Ellipse Opacity="0.5" />
            <Ellipse Opacity="0.6" />
            <Ellipse Opacity="0.7" />
        </core:RadialPanel>
    </UserControl>
    

    And its code-behind:

    public partial class SpinningWait : UserControl
    {
        private Storyboard _storyboard;
    
        public SpinningWait()
        {
            InitializeComponent();
        }
    
        public bool IsWaiting
        {
            get { return (bool)GetValue(IsWaitingProperty); }
            set { SetValue(IsWaitingProperty, value); }
        }
    
        public static readonly DependencyProperty IsWaitingProperty =
            DependencyProperty.Register("IsWaiting", typeof(bool), typeof(SpinningWait), new UIPropertyMetadata(false, new PropertyChangedCallback(OnIsWaitingChanged)));
    
    
        private static void OnIsWaitingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ((SpinningWait)d).OnIsWaitingChanged((object)d, e);
        }
    
        private void OnIsWaitingChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (IsWaiting)
            {
                this.Visibility = Visibility.Visible;
                this.StartAnimation();
            }
            else
            {
                this.Visibility = Visibility.Collapsed;
                this.StopAnimation();
            }
        }
    
        private void StartAnimation()
        {
            this._storyboard = (Storyboard)FindResource("canvasAnimation");
            this._storyboard.Begin(canvas, true);
        }
    
        private void StopAnimation()
        {
            this._storyboard.Remove(canvas);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created sample circular UIScrollview.it works fine.but i want to scroll through NSTimer
I have created a JSP / servlets application running in Tomcat 7. It runs
I have created an android application that calls (using kSOAP library) a SOAP based
I am assuming nhibernate can handle circular reference issues as I have not seen
I have created a widows application with setup project. I compiled and build.Everything looks
I have created a widows application with setup project. I compiled and build.Everything looks
I have created a QWidget with a bunch of QToolButtons in it and I
I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -
I have created some JQuery that will expand a div 'popup' on hover and
I have created an EDMX in visual studio 2010 SP1. It has been built

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.