Files
ShrlAlgoToolkit/WPFDark/Controls/BiaProgressPanel.xaml
ShrlAlgo 4d35cadb56 更新
2025-07-11 09:20:23 +08:00

51 lines
2.6 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFDark.Controls"
xmlns:wpf="clr-namespace:WPFDark">
<!-- https://stopbyte.com/t/how-to-make-a-wpf-progress-bar-with-animated-diagonal-lines-like-barber-pole/146 -->
<Style TargetType="{x:Type controls:BiaProgressPanel}">
<Setter Property="Height" Value="16" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border Background="#4B5260">
<Border Width="5000">
<Border.Background>
<DrawingBrush Stretch="None"
TileMode="Tile"
Viewbox="0,0,1,1"
Viewport="0,0,36,36"
ViewportUnits="Absolute">
<DrawingBrush.RelativeTransform>
<TranslateTransform />
</DrawingBrush.RelativeTransform>
<DrawingBrush.Drawing>
<GeometryDrawing Brush="#393F4B" Geometry="M0,0 18,0 36,36 18,36 Z" />
</DrawingBrush.Drawing>
</DrawingBrush>
</Border.Background>
<Border.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation RepeatBehavior="Forever"
Storyboard.TargetProperty="(Border.Background).(DrawingBrush.RelativeTransform).(TranslateTransform.X)"
From="0.0"
To=".36"
Duration="0:0:18" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Border.Triggers>
</Border>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>