整理代码
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
|
||||
xmlns:internal="clr-namespace:Melskin.Converters.Internal"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:internal="clr-namespace:Melskin.Converters.Internal">
|
||||
|
||||
<!--#region SlotProgress-->
|
||||
<ControlTemplate TargetType="{x:Type ProgressBar}" x:Key="SlotHorizontalProgressTemplate">
|
||||
<ControlTemplate x:Key="SlotHorizontalProgressTemplate" TargetType="{x:Type ProgressBar}">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard RepeatBehavior="Forever" x:Key="ProgressIndeterminateHorizontal">
|
||||
<Storyboard x:Key="ProgressIndeterminateHorizontal" RepeatBehavior="Forever">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground.(Brush.RelativeTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="-1" />
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="1" />
|
||||
@@ -15,13 +15,13 @@
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<decorations:SlotBorder
|
||||
x:Name="backgroundBorder"
|
||||
Padding="2"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Intensity="0.7"
|
||||
Padding="2"
|
||||
x:Name="backgroundBorder">
|
||||
<Grid HorizontalAlignment="Left" x:Name="BarGrid">
|
||||
Intensity="0.7">
|
||||
<Grid x:Name="BarGrid" HorizontalAlignment="Left">
|
||||
<!-- 计算进度条宽度 -->
|
||||
<Grid.Width>
|
||||
<MultiBinding Converter="{x:Static internal:ValueToRangeWidthConverter.Instance}" ConverterParameter="7">
|
||||
@@ -45,18 +45,18 @@
|
||||
</Grid.Width>
|
||||
<!-- 背景模糊效果 -->
|
||||
<Border
|
||||
x:Name="borderBlur"
|
||||
Background="{TemplateBinding Foreground}"
|
||||
CornerRadius="3"
|
||||
x:Name="borderBlur">
|
||||
CornerRadius="3">
|
||||
<Border.Effect>
|
||||
<BlurEffect Radius="8" />
|
||||
</Border.Effect>
|
||||
</Border>
|
||||
<!-- 进度条 -->
|
||||
<Border
|
||||
x:Name="borderProgress"
|
||||
Background="{TemplateBinding Foreground}"
|
||||
CornerRadius="3"
|
||||
x:Name="borderProgress" />
|
||||
CornerRadius="3" />
|
||||
</Grid>
|
||||
|
||||
</decorations:SlotBorder>
|
||||
@@ -66,11 +66,11 @@
|
||||
<Condition Property="IsIndeterminate" Value="True" />
|
||||
<Condition Property="IsEnabled" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Width" TargetName="BarGrid" Value="auto" />
|
||||
<Setter Property="HorizontalAlignment" TargetName="BarGrid" Value="Stretch" />
|
||||
<Setter TargetName="BarGrid" Property="Width" Value="auto" />
|
||||
<Setter TargetName="BarGrid" Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryIndeterminateGradientBrush}" />
|
||||
<MultiTrigger.EnterActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource ProgressIndeterminateHorizontal}" x:Name="beginIndeterminate" />
|
||||
<BeginStoryboard x:Name="beginIndeterminate" Storyboard="{StaticResource ProgressIndeterminateHorizontal}" />
|
||||
</MultiTrigger.EnterActions>
|
||||
<MultiTrigger.ExitActions>
|
||||
<RemoveStoryboard BeginStoryboardName="beginIndeterminate" />
|
||||
@@ -99,9 +99,9 @@
|
||||
</LinearGradientBrush.RelativeTransform>
|
||||
</LinearGradientBrush>
|
||||
-->
|
||||
<ControlTemplate TargetType="{x:Type ProgressBar}" x:Key="SlotProgressVerticalTemplate">
|
||||
<ControlTemplate x:Key="SlotProgressVerticalTemplate" TargetType="{x:Type ProgressBar}">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard RepeatBehavior="Forever" x:Key="ProgressIndeterminateVertical">
|
||||
<Storyboard x:Key="ProgressIndeterminateVertical" RepeatBehavior="Forever">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground.(Brush.RelativeTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="1" />
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-1" />
|
||||
@@ -109,13 +109,13 @@
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<decorations:SlotBorder
|
||||
x:Name="backgroundBorder"
|
||||
Padding="2"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Intensity="0.7"
|
||||
Padding="2"
|
||||
x:Name="backgroundBorder">
|
||||
<Grid VerticalAlignment="Bottom" x:Name="BarGrid">
|
||||
Intensity="0.7">
|
||||
<Grid x:Name="BarGrid" VerticalAlignment="Bottom">
|
||||
<!-- 计算进度条宽度 -->
|
||||
<Grid.Height>
|
||||
<MultiBinding Converter="{x:Static internal:ValueToRangeWidthConverter.Instance}" ConverterParameter="7">
|
||||
@@ -164,11 +164,11 @@
|
||||
<Condition Property="IsIndeterminate" Value="True" />
|
||||
<Condition Property="IsEnabled" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Height" TargetName="BarGrid" Value="auto" />
|
||||
<Setter Property="VerticalAlignment" TargetName="BarGrid" Value="Stretch" />
|
||||
<Setter TargetName="BarGrid" Property="Height" Value="auto" />
|
||||
<Setter TargetName="BarGrid" Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryIndeterminateGradientBrush}" />
|
||||
<MultiTrigger.EnterActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource ProgressIndeterminateVertical}" x:Name="beginIndeterminate" />
|
||||
<BeginStoryboard x:Name="beginIndeterminate" Storyboard="{StaticResource ProgressIndeterminateVertical}" />
|
||||
</MultiTrigger.EnterActions>
|
||||
<MultiTrigger.ExitActions>
|
||||
<RemoveStoryboard BeginStoryboardName="beginIndeterminate" />
|
||||
@@ -177,7 +177,7 @@
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style TargetType="{x:Type ProgressBar}" x:Key="SlotProgressBarStyle">
|
||||
<Style x:Key="SlotProgressBarStyle" TargetType="{x:Type ProgressBar}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryGradientBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
@@ -201,9 +201,9 @@
|
||||
</Style>
|
||||
<!--#endregion-->
|
||||
|
||||
<ControlTemplate TargetType="{x:Type ProgressBar}" x:Key="HorizontalProgressTemplate">
|
||||
<ControlTemplate x:Key="HorizontalProgressTemplate" TargetType="{x:Type ProgressBar}">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard RepeatBehavior="Forever" x:Key="ProgressIndeterminateHorizontal">
|
||||
<Storyboard x:Key="ProgressIndeterminateHorizontal" RepeatBehavior="Forever">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground.(Brush.RelativeTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="-1" />
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="1" />
|
||||
@@ -211,12 +211,12 @@
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Border
|
||||
x:Name="backgroundBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
x:Name="backgroundBorder">
|
||||
<Grid HorizontalAlignment="Left" x:Name="BarGrid">
|
||||
CornerRadius="4">
|
||||
<Grid x:Name="BarGrid" HorizontalAlignment="Left">
|
||||
<!-- 计算进度条宽度 -->
|
||||
<Grid.Width>
|
||||
<MultiBinding Converter="{x:Static internal:ValueToRangeWidthConverter.Instance}" ConverterParameter="7">
|
||||
@@ -240,9 +240,9 @@
|
||||
</Grid.Width>
|
||||
<!-- 进度条 -->
|
||||
<Border
|
||||
x:Name="borderProgress"
|
||||
Background="{TemplateBinding Foreground}"
|
||||
CornerRadius="3"
|
||||
x:Name="borderProgress" />
|
||||
CornerRadius="3" />
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
@@ -252,11 +252,11 @@
|
||||
<Condition Property="IsIndeterminate" Value="True" />
|
||||
<Condition Property="IsEnabled" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Width" TargetName="BarGrid" Value="auto" />
|
||||
<Setter Property="HorizontalAlignment" TargetName="BarGrid" Value="Stretch" />
|
||||
<Setter TargetName="BarGrid" Property="Width" Value="auto" />
|
||||
<Setter TargetName="BarGrid" Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryIndeterminateGradientBrush}" />
|
||||
<MultiTrigger.EnterActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource ProgressIndeterminateHorizontal}" x:Name="beginIndeterminate" />
|
||||
<BeginStoryboard x:Name="beginIndeterminate" Storyboard="{StaticResource ProgressIndeterminateHorizontal}" />
|
||||
</MultiTrigger.EnterActions>
|
||||
<MultiTrigger.ExitActions>
|
||||
<RemoveStoryboard BeginStoryboardName="beginIndeterminate" />
|
||||
@@ -264,9 +264,9 @@
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
<ControlTemplate TargetType="{x:Type ProgressBar}" x:Key="ProgressVerticalTemplate">
|
||||
<ControlTemplate x:Key="ProgressVerticalTemplate" TargetType="{x:Type ProgressBar}">
|
||||
<ControlTemplate.Resources>
|
||||
<Storyboard RepeatBehavior="Forever" x:Key="ProgressIndeterminateVertical">
|
||||
<Storyboard x:Key="ProgressIndeterminateVertical" RepeatBehavior="Forever">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground.(Brush.RelativeTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
|
||||
<EasingDoubleKeyFrame KeyTime="0" Value="1" />
|
||||
<EasingDoubleKeyFrame KeyTime="0:0:2" Value="-1" />
|
||||
@@ -274,12 +274,12 @@
|
||||
</Storyboard>
|
||||
</ControlTemplate.Resources>
|
||||
<Border
|
||||
x:Name="backgroundBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
x:Name="backgroundBorder">
|
||||
<Grid VerticalAlignment="Bottom" x:Name="BarGrid">
|
||||
CornerRadius="4">
|
||||
<Grid x:Name="BarGrid" VerticalAlignment="Bottom">
|
||||
<!-- 计算进度条宽度 -->
|
||||
<Grid.Height>
|
||||
<MultiBinding Converter="{x:Static internal:ValueToRangeWidthConverter.Instance}" ConverterParameter="7">
|
||||
@@ -312,11 +312,11 @@
|
||||
<Condition Property="IsIndeterminate" Value="True" />
|
||||
<Condition Property="IsEnabled" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Height" TargetName="BarGrid" Value="auto" />
|
||||
<Setter Property="VerticalAlignment" TargetName="BarGrid" Value="Stretch" />
|
||||
<Setter TargetName="BarGrid" Property="Height" Value="auto" />
|
||||
<Setter TargetName="BarGrid" Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryIndeterminateGradientBrush}" />
|
||||
<MultiTrigger.EnterActions>
|
||||
<BeginStoryboard Storyboard="{StaticResource ProgressIndeterminateVertical}" x:Name="beginIndeterminate" />
|
||||
<BeginStoryboard x:Name="beginIndeterminate" Storyboard="{StaticResource ProgressIndeterminateVertical}" />
|
||||
</MultiTrigger.EnterActions>
|
||||
<MultiTrigger.ExitActions>
|
||||
<RemoveStoryboard BeginStoryboardName="beginIndeterminate" />
|
||||
|
||||
Reference in New Issue
Block a user