230 lines
13 KiB
XML
230 lines
13 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="Base/ProgressBarBaseStyle.xaml"></ResourceDictionary>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<Style BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarSuccess" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground" Value="{DynamicResource SuccessBrush}"/>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarInfo" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground" Value="{DynamicResource InfoBrush}"/>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarWarning" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground" Value="{DynamicResource WarningBrush}"/>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarDanger" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground" Value="{DynamicResource DangerBrush}"/>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarPrimaryStripe" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground">
|
|
<Setter.Value>
|
|
<DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
|
|
<DrawingBrush.Transform>
|
|
<TransformGroup>
|
|
<RotateTransform Angle="20"/>
|
|
<TranslateTransform x:Name="MyTransform" X="0"/>
|
|
</TransformGroup>
|
|
</DrawingBrush.Transform>
|
|
<DrawingBrush.Drawing>
|
|
<GeometryDrawing>
|
|
<GeometryDrawing.Brush>
|
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
|
<GradientStop Color="{DynamicResource DarkPrimaryColor}" Offset="0"/>
|
|
<GradientStop Color="{DynamicResource DarkPrimaryColor}" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</GeometryDrawing.Brush>
|
|
<GeometryDrawing.Geometry>
|
|
<RectangleGeometry Rect="0,0,20,32"></RectangleGeometry>
|
|
</GeometryDrawing.Geometry>
|
|
</GeometryDrawing>
|
|
</DrawingBrush.Drawing>
|
|
</DrawingBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ProgressBar}">
|
|
<ControlTemplate.Resources>
|
|
<Storyboard x:Key="OnLoaded">
|
|
<DoubleAnimationUsingKeyFrames RepeatBehavior="Forever" Storyboard.TargetProperty="(Border.Background).(Brush.Transform).(TransformGroup.Children)[1].(TranslateTransform.X)" Storyboard.TargetName="Indicator">
|
|
<LinearDoubleKeyFrame KeyTime="0" Value="0"/>
|
|
<LinearDoubleKeyFrame KeyTime="0:0:.25" Value="21"/>
|
|
</DoubleAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
</ControlTemplate.Resources>
|
|
<Grid x:Name="TemplateRoot" SnapsToDevicePixels="true">
|
|
<Border CornerRadius="4" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
|
<Border.Effect>
|
|
<BlurEffect Radius="2"></BlurEffect>
|
|
</Border.Effect>
|
|
</Border>
|
|
<Rectangle x:Name="PART_Track" Margin="1"/>
|
|
<Decorator x:Name="PART_Indicator" HorizontalAlignment="Left" Margin="1">
|
|
<Grid x:Name="Foreground">
|
|
<Border x:Name="Indicator" CornerRadius="4" Background="{TemplateBinding Foreground}"></Border>
|
|
</Grid>
|
|
</Decorator>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="Indicator">
|
|
<BeginStoryboard Storyboard="{StaticResource OnLoaded}"/>
|
|
</EventTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarSuccessStripe" BasedOn="{StaticResource ProgressBarPrimaryStripe}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground">
|
|
<Setter.Value>
|
|
<DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
|
|
<DrawingBrush.Transform>
|
|
<TransformGroup>
|
|
<RotateTransform Angle="20"/>
|
|
<TranslateTransform x:Name="MyTransform" X="0"/>
|
|
</TransformGroup>
|
|
</DrawingBrush.Transform>
|
|
<DrawingBrush.Drawing>
|
|
<GeometryDrawing>
|
|
<GeometryDrawing.Brush>
|
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
|
<GradientStop Color="{DynamicResource DarkSuccessColor}" Offset="0"/>
|
|
<GradientStop Color="{DynamicResource DarkSuccessColor}" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</GeometryDrawing.Brush>
|
|
<GeometryDrawing.Geometry>
|
|
<RectangleGeometry Rect="0,0,20,32"></RectangleGeometry>
|
|
</GeometryDrawing.Geometry>
|
|
</GeometryDrawing>
|
|
</DrawingBrush.Drawing>
|
|
</DrawingBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarInfoStripe" BasedOn="{StaticResource ProgressBarPrimaryStripe}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground">
|
|
<Setter.Value>
|
|
<DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
|
|
<DrawingBrush.Transform>
|
|
<TransformGroup>
|
|
<RotateTransform Angle="20"/>
|
|
<TranslateTransform x:Name="MyTransform" X="0"/>
|
|
</TransformGroup>
|
|
</DrawingBrush.Transform>
|
|
<DrawingBrush.Drawing>
|
|
<GeometryDrawing>
|
|
<GeometryDrawing.Brush>
|
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
|
<GradientStop Color="{DynamicResource DarkInfoColor}" Offset="0"/>
|
|
<GradientStop Color="{DynamicResource DarkInfoColor}" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</GeometryDrawing.Brush>
|
|
<GeometryDrawing.Geometry>
|
|
<RectangleGeometry Rect="0,0,20,32"></RectangleGeometry>
|
|
</GeometryDrawing.Geometry>
|
|
</GeometryDrawing>
|
|
</DrawingBrush.Drawing>
|
|
</DrawingBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarWarningStripe" BasedOn="{StaticResource ProgressBarPrimaryStripe}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground">
|
|
<Setter.Value>
|
|
<DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
|
|
<DrawingBrush.Transform>
|
|
<TransformGroup>
|
|
<RotateTransform Angle="20"/>
|
|
<TranslateTransform x:Name="MyTransform" X="0"/>
|
|
</TransformGroup>
|
|
</DrawingBrush.Transform>
|
|
<DrawingBrush.Drawing>
|
|
<GeometryDrawing>
|
|
<GeometryDrawing.Brush>
|
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
|
<GradientStop Color="{DynamicResource DarkWarningColor}" Offset="0"/>
|
|
<GradientStop Color="{DynamicResource DarkWarningColor}" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</GeometryDrawing.Brush>
|
|
<GeometryDrawing.Geometry>
|
|
<RectangleGeometry Rect="0,0,20,32"></RectangleGeometry>
|
|
</GeometryDrawing.Geometry>
|
|
</GeometryDrawing>
|
|
</DrawingBrush.Drawing>
|
|
</DrawingBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarDangerStripe" BasedOn="{StaticResource ProgressBarPrimaryStripe}" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Foreground">
|
|
<Setter.Value>
|
|
<DrawingBrush Viewport="0,0,20,32" TileMode="Tile" ViewportUnits="Absolute" Stretch="None">
|
|
<DrawingBrush.Transform>
|
|
<TransformGroup>
|
|
<RotateTransform Angle="20"/>
|
|
<TranslateTransform x:Name="MyTransform" X="0"/>
|
|
</TransformGroup>
|
|
</DrawingBrush.Transform>
|
|
<DrawingBrush.Drawing>
|
|
<GeometryDrawing>
|
|
<GeometryDrawing.Brush>
|
|
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
|
<GradientStop Color="{DynamicResource DarkDangerColor}" Offset="0"/>
|
|
<GradientStop Color="{DynamicResource DarkDangerColor}" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="0.5"/>
|
|
<GradientStop Color="White" Offset="1"/>
|
|
</LinearGradientBrush>
|
|
</GeometryDrawing.Brush>
|
|
<GeometryDrawing.Geometry>
|
|
<RectangleGeometry Rect="0,0,20,32"></RectangleGeometry>
|
|
</GeometryDrawing.Geometry>
|
|
</GeometryDrawing>
|
|
</DrawingBrush.Drawing>
|
|
</DrawingBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="ProgressBarFlat" TargetType="{x:Type ProgressBar}">
|
|
<Setter Property="Height" Value="4"></Setter>
|
|
<Setter Property="Background" Value="{DynamicResource BorderBrush}"></Setter>
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"></Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ProgressBar}">
|
|
<Grid x:Name="TemplateRoot" SnapsToDevicePixels="true">
|
|
<Rectangle x:Name="PART_Track" Fill="{TemplateBinding Background}" StrokeThickness="0" Stroke="{TemplateBinding BorderBrush}"/>
|
|
<Decorator x:Name="PART_Indicator" HorizontalAlignment="Left">
|
|
<Grid x:Name="Foreground">
|
|
<Rectangle x:Name="Indicator" Fill="{TemplateBinding Foreground}"/>
|
|
</Grid>
|
|
</Decorator>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
</ResourceDictionary> |