123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:hc="clr-namespace:HandyControl.Controls"
- xmlns:system="clr-namespace:System;assembly=mscorlib">
- <Style BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
- </Style>
- <Style x:Key="ProgressBarSuccess" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource SuccessBrush}"/>
- </Style>
- <Style x:Key="ProgressBarInfo" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource InfoBrush}"/>
- </Style>
- <Style x:Key="ProgressBarWarning" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource WarningBrush}"/>
- </Style>
- <Style x:Key="ProgressBarDanger" BasedOn="{StaticResource ProgressBarBaseStyle}" TargetType="ProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource DangerBrush}"/>
- </Style>
- <Style x:Key="ProgressBarPrimaryStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="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="{DynamicResource BackgroundColor}" Offset="0.5"/>
- <GradientStop Color="{DynamicResource BackgroundColor}" Offset="1"/>
- </LinearGradientBrush>
- </GeometryDrawing.Brush>
- <GeometryDrawing.Geometry>
- <RectangleGeometry Rect="0,0,20,32"/>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ProgressBarSuccessStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="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="{DynamicResource BackgroundColor}" Offset="0.5"/>
- <GradientStop Color="{DynamicResource BackgroundColor}" Offset="1"/>
- </LinearGradientBrush>
- </GeometryDrawing.Brush>
- <GeometryDrawing.Geometry>
- <RectangleGeometry Rect="0,0,20,32"/>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ProgressBarInfoStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="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="{DynamicResource BackgroundColor}" Offset="0.5"/>
- <GradientStop Color="{DynamicResource BackgroundColor}" Offset="1"/>
- </LinearGradientBrush>
- </GeometryDrawing.Brush>
- <GeometryDrawing.Geometry>
- <RectangleGeometry Rect="0,0,20,32"/>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ProgressBarWarningStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="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="{DynamicResource BackgroundColor}" Offset="0.5"/>
- <GradientStop Color="{DynamicResource BackgroundColor}" Offset="1"/>
- </LinearGradientBrush>
- </GeometryDrawing.Brush>
- <GeometryDrawing.Geometry>
- <RectangleGeometry Rect="0,0,20,32"/>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ProgressBarDangerStripe" BasedOn="{StaticResource ProgressBarStripeBaseStyle}" TargetType="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="{DynamicResource BackgroundColor}" Offset="0.5"/>
- <GradientStop Color="{DynamicResource BackgroundColor}" Offset="1"/>
- </LinearGradientBrush>
- </GeometryDrawing.Brush>
- <GeometryDrawing.Geometry>
- <RectangleGeometry Rect="0,0,20,32"/>
- </GeometryDrawing.Geometry>
- </GeometryDrawing>
- </DrawingBrush.Drawing>
- </DrawingBrush>
- </Setter.Value>
- </Setter>
- </Style>
- <Style BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="hc:CircleProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
- </Style>
- <Style x:Key="ProgressBarSuccessCircle" BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="hc:CircleProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource SuccessBrush}"/>
- </Style>
- <Style x:Key="ProgressBarInfoCircle" BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="hc:CircleProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource InfoBrush}"/>
- </Style>
- <Style x:Key="ProgressBarWarningCircle" BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="hc:CircleProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource WarningBrush}"/>
- </Style>
- <Style x:Key="ProgressBarDangerCircle" BasedOn="{StaticResource ProgressBarCircleBaseStyle}" TargetType="hc:CircleProgressBar">
- <Setter Property="Foreground" Value="{DynamicResource DangerBrush}"/>
- </Style>
- <Style BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="hc:WaveProgressBar">
- <Setter Property="WaveFill" Value="{DynamicResource DarkPrimaryBrush}"/>
- </Style>
- <Style x:Key="ProgressBarSuccessWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="hc:WaveProgressBar">
- <Setter Property="WaveFill" Value="{DynamicResource DarkSuccessBrush}"/>
- </Style>
- <Style x:Key="ProgressBarInfoWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="hc:WaveProgressBar">
- <Setter Property="WaveFill" Value="{DynamicResource DarkInfoBrush}"/>
- </Style>
- <Style x:Key="ProgressBarWarningWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="hc:WaveProgressBar">
- <Setter Property="WaveFill" Value="{DynamicResource DarkWarningBrush}"/>
- </Style>
- <Style x:Key="ProgressBarDangerWave" BasedOn="{StaticResource ProgressBarWaveBaseStyle}" TargetType="hc:WaveProgressBar">
- <Setter Property="WaveFill" Value="{DynamicResource DarkDangerBrush}"/>
- </Style>
- <Style x:Key="ProgressBarFlat" TargetType="ProgressBar">
- <Setter Property="Height" Value="4"/>
- <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
- <Setter Property="Foreground" Value="{DynamicResource PrimaryBrush}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ProgressBar">
- <ControlTemplate.Resources>
- <Storyboard x:Key="IsIndeterminate" RepeatBehavior="Forever">
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="Animation">
- <EasingDoubleKeyFrame KeyTime="0" Value="0.25"/>
- <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.25"/>
- <EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.25"/>
- </DoubleAnimationUsingKeyFrames>
- <PointAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)" Storyboard.TargetName="Animation">
- <EasingPointKeyFrame KeyTime="0" Value="-0.5,0.5"/>
- <EasingPointKeyFrame KeyTime="0:0:1" Value="0.5,0.5"/>
- <EasingPointKeyFrame KeyTime="0:0:2" Value="1.5,0.5"/>
- </PointAnimationUsingKeyFrames>
- </Storyboard>
- </ControlTemplate.Resources>
- <hc:SimplePanel x:Name="TemplateRoot" SnapsToDevicePixels="true" ClipToBounds="True">
- <Rectangle x:Name="PART_Track" Fill="{TemplateBinding Background}" StrokeThickness="0" Stroke="{TemplateBinding BorderBrush}"/>
- <Decorator x:Name="PART_Indicator" HorizontalAlignment="Left">
- <Rectangle x:Name="Indicator" Fill="{TemplateBinding Foreground}"/>
- </Decorator>
- <Rectangle x:Name="Animation" Visibility="Collapsed" Fill="{TemplateBinding Foreground}" RenderTransformOrigin="0.5,0.5">
- <Rectangle.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- </TransformGroup>
- </Rectangle.RenderTransform>
- </Rectangle>
- </hc:SimplePanel>
- <ControlTemplate.Triggers>
- <Trigger Property="IsIndeterminate" Value="true">
- <Trigger.EnterActions>
- <BeginStoryboard Storyboard="{StaticResource IsIndeterminate}"/>
- </Trigger.EnterActions>
- <Setter Property="Visibility" TargetName="Indicator" Value="Collapsed"/>
- <Setter Property="Visibility" TargetName="Animation" Value="Visible"/>
- </Trigger>
- <Trigger Property="Orientation" Value="Vertical">
- <Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
- <Setter Property="LayoutTransform" TargetName="TemplateRoot">
- <Setter.Value>
- <RotateTransform Angle="-90"/>
- </Setter.Value>
- </Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|