Ai
83 Star 691 Fork 233

WPFDevelopersOrg/WPFDevelopers

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Styles.Loading.xaml 12.31 KB
一键复制 编辑 原始数据 按行查看 历史
闫驚鏵(Jinhua Yan) 提交于 2025-12-27 00:25 +08:00 . Update Styles.Loading.xaml
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFDevelopers.Controls"
xmlns:shapes="clr-namespace:Microsoft.Expression.Drawing.Shapes"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Themes/Basic/ControlBasic.xaml" />
<ResourceDictionary Source="../Themes/Basic/Animations.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="WD.NormalLoading" TargetType="{x:Type controls:NormalLoading}">
<Setter Property="Width" Value="40" />
<Setter Property="Height" Value="40" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:NormalLoading}">
<Viewbox Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
<Grid>
<Grid.Resources>
<Storyboard x:Key="StarStoryboard" RepeatBehavior="Forever">
<DoubleAnimation
Storyboard.TargetName="PART_Ellipse"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
To="360"
Duration="0:0:1.0" />
</Storyboard>
</Grid.Resources>
<Ellipse
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Stroke="{DynamicResource WD.BaseBrush}"
StrokeDashArray="100,100"
StrokeThickness="2" />
<Ellipse
x:Name="PART_Ellipse"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
RenderTransformOrigin=".5,.5"
Stretch="Uniform"
Stroke="{DynamicResource WD.PrimaryBrush}"
StrokeDashArray="{TemplateBinding StrokeArray}"
StrokeThickness="2">
<Ellipse.RenderTransform>
<RotateTransform Angle="0" />
</Ellipse.RenderTransform>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard x:Name="LoadedBeginStoryboard" Storyboard="{StaticResource StarStoryboard}" />
</EventTrigger>
<EventTrigger RoutedEvent="Unloaded">
<StopStoryboard BeginStoryboardName="LoadedBeginStoryboard" />
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
</Grid>
</Viewbox>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style
x:Key="WD.DefaultLoading"
BasedOn="{StaticResource WD.ControlBasicStyle}"
TargetType="{x:Type controls:DefaultLoading}">
<Setter Property="BorderBrush" Value="{DynamicResource WD.PrimaryBrush}" />
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="40" />
<Setter Property="ArcThickness" Value="2" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:DefaultLoading}">
<ControlTemplate.Resources>
<Storyboard x:Key="WD.PlayStoryboard" RepeatBehavior="Forever">
<DoubleAnimation
RepeatBehavior="Forever"
Storyboard.TargetName="PART_Grid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
To="360"
Duration="0:0:0.784" />
<DoubleAnimationUsingKeyFrames
RepeatBehavior="Forever"
Storyboard.TargetName="PART_Arc"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
<SplineDoubleKeyFrame KeyTime="0" Value="0" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:0.666"
Value="135" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:1.333"
Value="270" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:1.999"
Value="405" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:2.666"
Value="540" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:3.333"
Value="675" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:3.999"
Value="810" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:4.666"
Value="945" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:5.332"
Value="1080" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames
RepeatBehavior="Forever"
Storyboard.TargetName="PART_Arc"
Storyboard.TargetProperty="(shapes:Arc.StartAngle)">
<SplineDoubleKeyFrame KeyTime="0" Value="-5" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:0.666"
Value="-130" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:1.333"
Value="-5" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames
RepeatBehavior="Forever"
Storyboard.TargetName="PART_Arc"
Storyboard.TargetProperty="(shapes:Arc.EndAngle)">
<SplineDoubleKeyFrame KeyTime="0" Value="5" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:0.666"
Value="130" />
<SplineDoubleKeyFrame
KeySpline="0.4,0.0,0.2,1"
KeyTime="0:0:1.333"
Value="5" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<Grid x:Name="PART_Grid" RenderTransformOrigin=".5,.5">
<Grid.RenderTransform>
<RotateTransform />
</Grid.RenderTransform>
<shapes:Arc
x:Name="PART_Arc"
Width="{TemplateBinding ActualWidth}"
Height="{TemplateBinding ActualHeight}"
ArcThickness="{TemplateBinding ArcThickness}"
EndAngle="5"
Fill="{TemplateBinding BorderBrush}"
RenderTransformOrigin=".5,.5"
StartAngle="-5"
Stretch="None"
StrokeThickness="0">
<shapes:Arc.RenderTransform>
<RotateTransform />
</shapes:Arc.RenderTransform>
</shapes:Arc>
</Grid>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard Storyboard="{StaticResource WD.PlayStoryboard}" />
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style
x:Key="WD.ProgressLoading"
BasedOn="{StaticResource WD.ControlBasicStyle}"
TargetType="{x:Type controls:ProgressLoading}">
<Setter Property="BorderBrush" Value="{DynamicResource WD.PrimaryBrush}" />
<Setter Property="Height" Value="40" />
<Setter Property="Width" Value="40" />
<Setter Property="ArcThickness" Value="2" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:ProgressLoading}">
<ControlTemplate.Resources>
<Storyboard x:Key="WD.PlayStoryboard" RepeatBehavior="Forever">
<DoubleAnimation
RepeatBehavior="Forever"
Storyboard.TargetName="PART_Grid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
To="360"
Duration="0:0:0.784" />
</Storyboard>
</ControlTemplate.Resources>
<Grid x:Name="PART_Grid" RenderTransformOrigin=".5,.5">
<Grid.RenderTransform>
<RotateTransform />
</Grid.RenderTransform>
<shapes:Arc
x:Name="PART_Arc"
Width="{TemplateBinding ActualWidth}"
Height="{TemplateBinding ActualHeight}"
ArcThickness="{TemplateBinding ArcThickness}"
EndAngle="{TemplateBinding Value}"
Fill="{TemplateBinding BorderBrush}"
StartAngle="0"
Stretch="None"
StrokeThickness="0" />
</Grid>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard Storyboard="{StaticResource WD.PlayStoryboard}" />
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource WD.NormalLoading}" TargetType="{x:Type controls:NormalLoading}" />
<Style BasedOn="{StaticResource WD.DefaultLoading}" TargetType="{x:Type controls:DefaultLoading}" />
<Style BasedOn="{StaticResource WD.ProgressLoading}" TargetType="{x:Type controls:ProgressLoading}" />
</ResourceDictionary>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/WPFDevelopersOrg/WPFDevelopers.git
git@gitee.com:WPFDevelopersOrg/WPFDevelopers.git
WPFDevelopersOrg
WPFDevelopers
WPFDevelopers
master

搜索帮助