WPF 等待动画控件

<UserControl x:Class="WPFUC.WaitFor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Width="120" Height="120">
    <UserControl.Background>
        <SolidColorBrush />
    </UserControl.Background>
    <Grid Background="Transparent" Name="LayoutRoot">
        <Grid.RenderTransform>
            <ScaleTransform x:Name="SpinnerScale" ScaleX="1.0" ScaleY="1.0" />
        </Grid.RenderTransform>
        <Canvas Height="120" HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" Width="120">
            <Canvas.RenderTransform>
                <RotateTransform x:Name="SpinnerRotate" Angle="0" />
            </Canvas.RenderTransform>
            <Canvas.Triggers>
                <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                    <BeginStoryboard>
                        <BeginStoryboard.Storyboard>
                            <Storyboard>
                                <DoubleAnimation Duration="0:0:01" From="0" RepeatBehavior="Forever" Storyboard.TargetName="SpinnerRotate" Storyboard.TargetProperty="(RotateTransform.Angle)" To="360" />
                            </Storyboard>
                        </BeginStoryboard.Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Canvas.Triggers>
            <Ellipse Canvas.Left="47.2783" Canvas.Top="0.5" Fill="Orange" Height="21.862" Opacity="1" Stretch="Fill" Width="21.835" />
            <Ellipse Canvas.Left="20.1696" Canvas.Top="9.76358" Fill="Orange" Height="21.862" Opacity="0.9" Stretch="Fill" Width="21.835" />
            <Ellipse Canvas.Left="2.86816" Canvas.Top="29.9581" Fill="Orange" Height="21.862" Opacity="0.8" Stretch="Fill" Width="21.835" />
            <Ellipse Canvas.Left="5.03758e-006" Canvas.Top="57.9341" Fill="Orange" Height="21.862" Opacity="0.7" Stretch="Fill" Width="21.835" />
            <Ellipse Canvas.Left="12.1203" Canvas.Top="83.3163" Fill="Orange" Height="21.862" Opacity="0.6" Stretch="Fill" Width="21.835" />
            <Ellipse Canvas.Left="36.5459" Canvas.Top="98.138" Fill="Orange" Height="21.862" Opacity="0.5" Stretch="Fill" Width="21.835" />
            <Ellipse Canvas.Left="64.6723" Canvas.Top="96.8411" Fill="Orange" Height="21.862" Opacity="0.4" Stretch="Fill" Width="21.835" />
            <Ellipse Canvas.Left="87.6176" Canvas.Top="81.2783" Fill="Orange" Height="21.862" Opacity="0.3" Stretch="Fill" Width="21.835" />
            <Ellipse Canvas.Left="98.165" Canvas.Top="54.414" Fill="Orange" Height="21.862" Opacity="0.2" Stretch="Fill" Width="21.835" />
            <Ellipse Canvas.Left="92.9838" Canvas.Top="26.9938" Fill="Orange" Height="21.862" Opacity="0.1" Stretch="Fill" Width="21.835" />
        </Canvas>
    </Grid>
</UserControl>
原文地址:https://www.cnblogs.com/kearney908/p/6136284.html