273 lines
20 KiB
Plaintext
273 lines
20 KiB
Plaintext
|
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
|
xmlns:converters="clr-namespace:AntdWpf.Converters"
|
||
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||
|
|
<sys:Double x:Key="ProgressContentMinWidth">63.0</sys:Double>
|
||
|
|
<SolidColorBrush x:Key="ProgressBar.Progress" Color="#FF06B025" />
|
||
|
|
<SolidColorBrush x:Key="ProgressBar.Background" Color="#FFE6E6E6" />
|
||
|
|
<SolidColorBrush x:Key="ProgressBar.Border" Color="#FFBCBCBC" />
|
||
|
|
<Style TargetType="{x:Type ProgressBar}">
|
||
|
|
<Setter Property="Background" Value="{DynamicResource BorderBrushSecondary}" />
|
||
|
|
<Setter Property="BorderBrush" Value="{StaticResource ProgressBar.Border}" />
|
||
|
|
<Setter Property="BorderThickness" Value="0" />
|
||
|
|
<Setter Property="ClipToBounds" Value="False" />
|
||
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}" />
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ProgressBar}">
|
||
|
|
|
||
|
|
<Grid x:Name="TemplateRoot">
|
||
|
|
<VisualStateManager.VisualStateGroups>
|
||
|
|
<VisualStateGroup x:Name="CommonStates">
|
||
|
|
<VisualState x:Name="Determinate" />
|
||
|
|
<VisualState x:Name="Indeterminate">
|
||
|
|
<Storyboard RepeatBehavior="Forever">
|
||
|
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Animation" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
|
||
|
|
<EasingDoubleKeyFrame Value="0.25" KeyTime="0" />
|
||
|
|
<EasingDoubleKeyFrame Value="0.25" KeyTime="0:0:1" />
|
||
|
|
<EasingDoubleKeyFrame Value="0.25" KeyTime="0:0:2" />
|
||
|
|
</DoubleAnimationUsingKeyFrames>
|
||
|
|
<PointAnimationUsingKeyFrames Storyboard.TargetName="Animation" Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)">
|
||
|
|
<EasingPointKeyFrame Value="-0.5,0.5" KeyTime="0" />
|
||
|
|
<EasingPointKeyFrame Value="0.5,0.5" KeyTime="0:0:1" />
|
||
|
|
<EasingPointKeyFrame Value="1.5,0.5" KeyTime="0:0:2" />
|
||
|
|
</PointAnimationUsingKeyFrames>
|
||
|
|
</Storyboard>
|
||
|
|
</VisualState>
|
||
|
|
</VisualStateGroup>
|
||
|
|
</VisualStateManager.VisualStateGroups>
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition />
|
||
|
|
<ColumnDefinition Width="auto" />
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
<Border BorderThickness="{TemplateBinding BorderThickness}" />
|
||
|
|
<Rectangle x:Name="PART_Track"
|
||
|
|
Height="8"
|
||
|
|
Fill="{TemplateBinding Background}"
|
||
|
|
RadiusX="{Binding RelativeSource={RelativeSource Mode=Self},
|
||
|
|
Path=ActualHeight,
|
||
|
|
Converter={converters:MathConverter Operation=Divide},
|
||
|
|
ConverterParameter=2}"
|
||
|
|
RadiusY="{Binding RelativeSource={RelativeSource Mode=Self},
|
||
|
|
Path=ActualHeight,
|
||
|
|
Converter={converters:MathConverter Operation=Divide},
|
||
|
|
ConverterParameter=2}" />
|
||
|
|
<Border Height="8"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
ClipToBounds="True"
|
||
|
|
CornerRadius="{Binding Height,
|
||
|
|
Mode=OneWay,
|
||
|
|
RelativeSource={RelativeSource Self},
|
||
|
|
Converter={converters:DoubleToCornerRadiusConverter},
|
||
|
|
ConverterParameter=2}">
|
||
|
|
|
||
|
|
<Grid x:Name="PART_Indicator"
|
||
|
|
HorizontalAlignment="Left"
|
||
|
|
ClipToBounds="true">
|
||
|
|
<Rectangle x:Name="Indicator"
|
||
|
|
Fill="{TemplateBinding Foreground}"
|
||
|
|
RadiusX="{Binding ElementName=PART_Track, Path=RadiusX}"
|
||
|
|
RadiusY="{Binding ElementName=PART_Track, Path=RadiusY}" />
|
||
|
|
<Rectangle x:Name="Animation"
|
||
|
|
Fill="{TemplateBinding Foreground}"
|
||
|
|
RadiusX="{Binding ElementName=PART_Track, Path=RadiusX}"
|
||
|
|
RadiusY="{Binding ElementName=PART_Track, Path=RadiusY}"
|
||
|
|
RenderTransformOrigin="0.5,0.5">
|
||
|
|
<Rectangle.RenderTransform>
|
||
|
|
<TransformGroup>
|
||
|
|
<ScaleTransform />
|
||
|
|
<SkewTransform />
|
||
|
|
<RotateTransform />
|
||
|
|
<TranslateTransform />
|
||
|
|
</TransformGroup>
|
||
|
|
</Rectangle.RenderTransform>
|
||
|
|
</Rectangle>
|
||
|
|
</Grid>
|
||
|
|
</Border>
|
||
|
|
<TextBlock x:Name="ValueContent"
|
||
|
|
Grid.Column="1"
|
||
|
|
Margin="4,-2,0,0"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Foreground="{DynamicResource InputForeground}"
|
||
|
|
Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
||
|
|
Path=Value,
|
||
|
|
StringFormat='\{0:F0}%'}" />
|
||
|
|
<Grid Grid.Column="1"
|
||
|
|
Width="14"
|
||
|
|
Height="14"
|
||
|
|
Margin="4,0"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Name="pathDone"
|
||
|
|
Visibility="Collapsed">
|
||
|
|
|
||
|
|
<Ellipse Width="14"
|
||
|
|
Height="14"
|
||
|
|
Fill="{DynamicResource SuccessBrush}" />
|
||
|
|
|
||
|
|
|
||
|
|
<Path Height="6"
|
||
|
|
Data="M16.3819 8.27342H15.2827C15.0436 8.27342 14.8163 8.38827 14.6757 8.58514L10.9913 13.6945L9.32252 11.3789C9.18189 11.1844 8.95689 11.0672 8.71549 11.0672H7.61626C7.46392 11.0672 7.37486 11.2406 7.46392 11.3648L10.3842 15.4148C10.4532 15.5111 10.5442 15.5896 10.6495 15.6437C10.7549 15.6978 10.8717 15.7261 10.9901 15.7261C11.1086 15.7261 11.2253 15.6978 11.3307 15.6437C11.436 15.5896 11.527 15.5111 11.596 15.4148L16.5319 8.57108C16.6233 8.44686 16.5343 8.27342 16.3819 8.27342Z"
|
||
|
|
Fill="White"
|
||
|
|
Stretch="Uniform"
|
||
|
|
StrokeThickness="30" />
|
||
|
|
</Grid>
|
||
|
|
</Grid>
|
||
|
|
<ControlTemplate.Triggers>
|
||
|
|
<Trigger Property="Orientation" Value="Vertical">
|
||
|
|
<Setter TargetName="TemplateRoot" Property="LayoutTransform">
|
||
|
|
<Setter.Value>
|
||
|
|
<RotateTransform Angle="-90" />
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="IsIndeterminate" Value="true">
|
||
|
|
<Setter TargetName="Indicator" Property="Visibility" Value="Collapsed" />
|
||
|
|
<Setter TargetName="ValueContent" Property="Visibility" Value="Collapsed" />
|
||
|
|
</Trigger>
|
||
|
|
<Trigger Property="Value" Value="100">
|
||
|
|
<Setter Property="Foreground" Value="{DynamicResource SuccessBrush}" />
|
||
|
|
<Setter TargetName="ValueContent" Property="Visibility" Value="Collapsed" />
|
||
|
|
<Setter TargetName="pathDone" Property="Visibility" Value="Visible" />
|
||
|
|
</Trigger>
|
||
|
|
</ControlTemplate.Triggers>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
<Style x:Key="Ant.CircularProgressBar" TargetType="ProgressBar">
|
||
|
|
<Setter Property="BorderThickness" Value="4" />
|
||
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}" />
|
||
|
|
<Setter Property="Template">
|
||
|
|
<Setter.Value>
|
||
|
|
<ControlTemplate TargetType="{x:Type ProgressBar}">
|
||
|
|
<Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Width}">
|
||
|
|
|
||
|
|
<Grid x:Name="PathGrid" Margin="2" />
|
||
|
|
|
||
|
|
<Canvas>
|
||
|
|
<Path Canvas.Left="2"
|
||
|
|
Canvas.Top="2"
|
||
|
|
Stroke="{DynamicResource BorderBrushSecondary}"
|
||
|
|
StrokeThickness="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=BorderThickness.Left}">
|
||
|
|
<Path.Data>
|
||
|
|
<PathGeometry>
|
||
|
|
<PathFigure StartPoint="{Binding ElementName=PathGrid,
|
||
|
|
Path=ActualWidth,
|
||
|
|
Converter={converters:StartPointConverter},
|
||
|
|
Mode=OneWay}">
|
||
|
|
<ArcSegment Size="{Binding ElementName=PathGrid,
|
||
|
|
Path=ActualWidth,
|
||
|
|
Converter={converters:ArcSizeConverter},
|
||
|
|
Mode=OneWay}" SweepDirection="Clockwise">
|
||
|
|
<ArcSegment.Point>
|
||
|
|
<MultiBinding Converter="{converters:ArcEndPointConverter}" ConverterParameter="{x:Static converters:ArcEndPointConverter.ParameterMidPoint}">
|
||
|
|
<Binding ElementName="PathGrid" Path="ActualWidth" />
|
||
|
|
<Binding Path="Maximum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
<Binding Path="Minimum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
<Binding Path="Maximum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
</MultiBinding>
|
||
|
|
</ArcSegment.Point>
|
||
|
|
</ArcSegment>
|
||
|
|
<ArcSegment Size="{Binding ElementName=PathGrid,
|
||
|
|
Path=ActualWidth,
|
||
|
|
Converter={converters:ArcSizeConverter},
|
||
|
|
Mode=OneWay}" SweepDirection="Clockwise">
|
||
|
|
<ArcSegment.Point>
|
||
|
|
<MultiBinding Converter="{converters:ArcEndPointConverter}">
|
||
|
|
<Binding ElementName="PathGrid" Path="ActualWidth" />
|
||
|
|
<Binding Path="Maximum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
<Binding Path="Minimum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
<Binding Path="Maximum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
</MultiBinding>
|
||
|
|
</ArcSegment.Point>
|
||
|
|
</ArcSegment>
|
||
|
|
</PathFigure>
|
||
|
|
</PathGeometry>
|
||
|
|
</Path.Data>
|
||
|
|
</Path>
|
||
|
|
<Path x:Name="Path"
|
||
|
|
Canvas.Left="2"
|
||
|
|
Canvas.Top="2"
|
||
|
|
Stroke="{TemplateBinding Foreground}"
|
||
|
|
StrokeEndLineCap="Round"
|
||
|
|
StrokeLineJoin="Round"
|
||
|
|
StrokeStartLineCap="Round"
|
||
|
|
StrokeThickness="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=BorderThickness.Left}">
|
||
|
|
<Path.Data>
|
||
|
|
<PathGeometry>
|
||
|
|
<PathFigure StartPoint="{Binding ElementName=PathGrid,
|
||
|
|
Path=ActualWidth,
|
||
|
|
Converter={converters:StartPointConverter},
|
||
|
|
Mode=OneWay}">
|
||
|
|
<ArcSegment Size="{Binding ElementName=PathGrid,
|
||
|
|
Path=ActualWidth,
|
||
|
|
Converter={converters:ArcSizeConverter},
|
||
|
|
Mode=OneWay}" SweepDirection="Clockwise">
|
||
|
|
<ArcSegment.Point>
|
||
|
|
<MultiBinding Converter="{converters:ArcEndPointConverter}" ConverterParameter="{x:Static converters:ArcEndPointConverter.ParameterMidPoint}">
|
||
|
|
<Binding ElementName="PathGrid" Path="ActualWidth" />
|
||
|
|
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
<Binding Path="Minimum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
<Binding Path="Maximum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
</MultiBinding>
|
||
|
|
</ArcSegment.Point>
|
||
|
|
</ArcSegment>
|
||
|
|
<ArcSegment Size="{Binding ElementName=PathGrid,
|
||
|
|
Path=ActualWidth,
|
||
|
|
Converter={converters:ArcSizeConverter},
|
||
|
|
Mode=OneWay}" SweepDirection="Clockwise">
|
||
|
|
<ArcSegment.Point>
|
||
|
|
<MultiBinding Converter="{converters:ArcEndPointConverter}">
|
||
|
|
<Binding ElementName="PathGrid" Path="ActualWidth" />
|
||
|
|
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
<Binding Path="Minimum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
<Binding Path="Maximum" RelativeSource="{RelativeSource TemplatedParent}" />
|
||
|
|
</MultiBinding>
|
||
|
|
</ArcSegment.Point>
|
||
|
|
</ArcSegment>
|
||
|
|
</PathFigure>
|
||
|
|
</PathGeometry>
|
||
|
|
</Path.Data>
|
||
|
|
</Path>
|
||
|
|
</Canvas>
|
||
|
|
<TextBlock x:Name="ValueContent"
|
||
|
|
HorizontalAlignment="Center"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
FontSize="22"
|
||
|
|
Foreground="{DynamicResource InputForeground}"
|
||
|
|
Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},
|
||
|
|
Path=Value,
|
||
|
|
StringFormat='\{0:F0}%'}" />
|
||
|
|
<Viewbox Margin="22"
|
||
|
|
HorizontalAlignment="Center"
|
||
|
|
VerticalAlignment="Center">
|
||
|
|
|
||
|
|
<Path Width="24"
|
||
|
|
Height="24"
|
||
|
|
Data="M21.3745 4.45312H19.7362C19.5065 4.45312 19.2885 4.55859 19.1479 4.73906L9.48462 16.9805L4.85103 11.1094C4.78093 11.0204 4.69159 10.9484 4.5897 10.8989C4.48781 10.8494 4.37603 10.8236 4.26274 10.8234H2.62446C2.46743 10.8234 2.38071 11.0039 2.47681 11.1258L8.89634 19.2586C9.19634 19.6383 9.7729 19.6383 10.0752 19.2586L21.5221 4.75313C21.6182 4.63359 21.5315 4.45312 21.3745 4.45312Z"
|
||
|
|
Fill="{DynamicResource SuccessBrush}"
|
||
|
|
Name="pathDone"
|
||
|
|
StrokeThickness="30"
|
||
|
|
Visibility="Collapsed" />
|
||
|
|
</Viewbox>
|
||
|
|
|
||
|
|
|
||
|
|
</Grid>
|
||
|
|
<ControlTemplate.Triggers>
|
||
|
|
<DataTrigger Value="True" Binding="{Binding ElementName=PathGrid,
|
||
|
|
Path=ActualWidth,
|
||
|
|
Converter={converters:LessThanConverter},
|
||
|
|
ConverterParameter={StaticResource ProgressContentMinWidth}}">
|
||
|
|
<Setter TargetName="ValueContent" Property="Visibility" Value="Collapsed" />
|
||
|
|
</DataTrigger>
|
||
|
|
<Trigger Property="Value" Value="100">
|
||
|
|
<Setter Property="Foreground" Value="{DynamicResource SuccessBrush}" />
|
||
|
|
<Setter TargetName="ValueContent" Property="Visibility" Value="Collapsed" />
|
||
|
|
<Setter TargetName="pathDone" Property="Visibility" Value="Visible" />
|
||
|
|
</Trigger>
|
||
|
|
</ControlTemplate.Triggers>
|
||
|
|
</ControlTemplate>
|
||
|
|
</Setter.Value>
|
||
|
|
</Setter>
|
||
|
|
</Style>
|
||
|
|
</ResourceDictionary>
|