1 Star 0 Fork 0

Chenyliang / WPF仿win10加载动画

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
MainWindow.xaml 5.94 KB
一键复制 编辑 原始数据 按行查看 历史
Chenyliang 提交于 2022-02-22 14:52 . [V1.0]0222 initial
<Window x:Class="WPFTest1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WPFTest1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="450">
<Grid Background="Transparent" Margin="60" Name="Stage" ClipToBounds="True">
<Button Width="70" Height="30" Margin="0,200,0,0" Content="start">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard >
<Storyboard>
<!--关键帧动画-->
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" BeginTime="0:0:0"
Storyboard.TargetName="element1"
Storyboard.TargetProperty="RenderTransform.Angle">
<SplineDoubleKeyFrame Value="0" KeyTime="0:0:0"/>
<SplineDoubleKeyFrame Value="360" KeyTime="0:0:2" KeySpline="0.1,0.49,0.91,0.5"/>
<SplineDoubleKeyFrame Value="720" KeyTime="0:0:4" KeySpline="0.1,0.5,0.91,0.51" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" BeginTime="0:0:0.2"
Storyboard.TargetName="element2"
Storyboard.TargetProperty="RenderTransform.Angle">
<SplineDoubleKeyFrame Value="0" KeyTime="0:0:0"/>
<SplineDoubleKeyFrame Value="360" KeyTime="0:0:2" KeySpline="0.1,0.49,0.91,0.5"/>
<SplineDoubleKeyFrame Value="720" KeyTime="0:0:4" KeySpline="0.1,0.5,0.91,0.51" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" BeginTime="0:0:0.4"
Storyboard.TargetName="element3"
Storyboard.TargetProperty="RenderTransform.Angle">
<SplineDoubleKeyFrame Value="0" KeyTime="0:0:0"/>
<SplineDoubleKeyFrame Value="360" KeyTime="0:0:2" KeySpline="0.1,0.49,0.91,0.5"/>
<SplineDoubleKeyFrame Value="720" KeyTime="0:0:4" KeySpline="0.1,0.5,0.91,0.51" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" BeginTime="0:0:0.6"
Storyboard.TargetName="element4"
Storyboard.TargetProperty="RenderTransform.Angle">
<SplineDoubleKeyFrame Value="0" KeyTime="0:0:0"/>
<SplineDoubleKeyFrame Value="360" KeyTime="0:0:2" KeySpline="0.1,0.49,0.91,0.5"/>
<SplineDoubleKeyFrame Value="720" KeyTime="0:0:4" KeySpline="0.1,0.5,0.91,0.51" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" BeginTime="0:0:0.8"
Storyboard.TargetName="element5"
Storyboard.TargetProperty="RenderTransform.Angle">
<SplineDoubleKeyFrame Value="0" KeyTime="0:0:0"/>
<SplineDoubleKeyFrame Value="360" KeyTime="0:0:2" KeySpline="0.1,0.49,0.91,0.5"/>
<SplineDoubleKeyFrame Value="720" KeyTime="0:0:4" KeySpline="0.1,0.5,0.91,0.51" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
</Button>
<Grid Width="100" Height="100">
<ContentControl RenderTransformOrigin="0.5,0.5" Name="element1">
<ContentControl.RenderTransform >
<RotateTransform Angle="0"/>
</ContentControl.RenderTransform>
<Ellipse Fill="#FF5A5858" Width="10" Height="10" VerticalAlignment="Bottom"/>
</ContentControl>
<ContentControl RenderTransformOrigin="0.5,0.5" Name="element2">
<ContentControl.RenderTransform >
<RotateTransform Angle="0"/>
</ContentControl.RenderTransform>
<Ellipse Fill="#FF5A5858" Width="10" Height="10" VerticalAlignment="Bottom"/>
</ContentControl>
<ContentControl RenderTransformOrigin="0.5,0.5" Name="element3">
<ContentControl.RenderTransform >
<RotateTransform Angle="0"/>
</ContentControl.RenderTransform>
<Ellipse Fill="#FF5A5858" Width="10" Height="10" VerticalAlignment="Bottom"/>
</ContentControl>
<ContentControl RenderTransformOrigin="0.5,0.5" Name="element4">
<ContentControl.RenderTransform >
<RotateTransform Angle="0"/>
</ContentControl.RenderTransform>
<Ellipse Fill="#FF5A5858" Width="10" Height="10" VerticalAlignment="Bottom"/>
</ContentControl>
<ContentControl RenderTransformOrigin="0.5,0.5" Name="element5">
<ContentControl.RenderTransform >
<RotateTransform Angle="0"/>
</ContentControl.RenderTransform>
<Ellipse Fill="#FF5A5858" Width="10" Height="10" VerticalAlignment="Bottom"/>
</ContentControl>
</Grid>
</Grid>
</Window>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/Chenyliang/WPF_Like_Win10_LoadingAmintaion.git
git@gitee.com:Chenyliang/WPF_Like_Win10_LoadingAmintaion.git
Chenyliang
WPF_Like_Win10_LoadingAmintaion
WPF仿win10加载动画
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891