C# WPF C轮盘游戏

C# WPF C轮盘游戏,c#,wpf,C#,Wpf,我想在WPF C中创建轮盘赌游戏,下面提到的代码工作正常,但我想在3秒钟后停止轮盘赌,但我不知道怎么做。请帮我解决同样的问题 <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="WpfApplication2.MainWindow" Title="MainWindow"

我想在WPF C中创建轮盘赌游戏,下面提到的代码工作正常,但我想在3秒钟后停止轮盘赌,但我不知道怎么做。请帮我解决同样的问题

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="WpfApplication2.MainWindow" Title="MainWindow" WindowState="Maximized">
<Canvas>
    <Canvas.Background>
        <ImageBrush ImageSource="Image/Background.jpg" AlignmentX="Right" AlignmentY="Bottom" Stretch="None"/>
    </Canvas.Background>
    <Ellipse Height="250" Width="250" Margin="200,100,-200,-100">
        <Ellipse.Fill>
            <ImageBrush x:Name="p2" ImageSource="Image/p2.png"/>
        </Ellipse.Fill>
        <Ellipse.RenderTransform>
            <RotateTransform x:Name="TransRotate11" CenterX="125" CenterY="125"/>
        </Ellipse.RenderTransform>
        <Ellipse.Triggers>
            <EventTrigger RoutedEvent="Image.Loaded">
                <BeginStoryboard>
                    <Storyboard x:Uid="s1" TargetProperty="Angle" RepeatBehavior="Forever">
                        <DoubleAnimation By="360" Duration="0:0:0.1" Storyboard.TargetName="TransRotate11" Storyboard.TargetProperty="Angle" FillBehavior="Stop"/>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </Ellipse.Triggers>
    </Ellipse>
</Canvas>

如果动画的持续时间为0.1秒,并且希望它运行3秒,为什么不简单地将其RepeatBehavior设置为30次:

<Storyboard x:Uid="s1">
    <DoubleAnimation Storyboard.TargetName="TransRotate11"
                     Storyboard.TargetProperty="Angle"
                     By="360" Duration="0:0:0.1"
                     RepeatBehavior="30x" FillBehavior="Stop" />
</Storyboard>

请输入格式化后的XAML代码。