优化更新代码,添加界面功能并整合
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:WPFluent.Controls">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/WPFluent;component/Controls/NavigationView/NavigationViewConstants.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="BasePaneButtonStyle" TargetType="{x:Type controls:Button}">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="{StaticResource PaneToggleButtonThickness}" />
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<Setter Property="MinHeight" Value="{StaticResource PaneToggleButtonHeight}" />
|
||||
<Setter Property="MinWidth" Value="{StaticResource PaneToggleButtonWidth}" />
|
||||
<Setter Property="Padding" Value="10" />
|
||||
<Setter Property="Border.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:Button}">
|
||||
<Border
|
||||
x:Name="LayoutRoot"
|
||||
MinWidth="{TemplateBinding MinWidth}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
Margin="0"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Background="Transparent"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding Border.CornerRadius}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ContentPresenter
|
||||
x:Name="Icon"
|
||||
Grid.Column="0"
|
||||
Margin="0,0,20,0"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Icon}"
|
||||
Focusable="False"
|
||||
RenderTransformOrigin="0.5, 0.5"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}">
|
||||
<ContentPresenter.RenderTransform>
|
||||
<ScaleTransform x:Name="IconScaleTransform" ScaleX="1.0" ScaleY="1.0" />
|
||||
</ContentPresenter.RenderTransform>
|
||||
</ContentPresenter>
|
||||
|
||||
<ContentPresenter Grid.Column="1" Content="{TemplateBinding Content}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundDisabled}" />
|
||||
<Setter TargetName="Icon" Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundDisabled}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Content" Value="{x:Null}">
|
||||
<Setter TargetName="Icon" Property="Margin" Value="0" />
|
||||
</Trigger>
|
||||
<EventTrigger RoutedEvent="Button.PreviewMouseLeftButtonDown">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Storyboard.TargetName="IconScaleTransform"
|
||||
Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
|
||||
From="1.0"
|
||||
To="0.85"
|
||||
Duration="0:0:0.08" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
<EventTrigger RoutedEvent="Button.PreviewMouseLeftButtonUp">
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Storyboard.TargetName="IconScaleTransform"
|
||||
Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
|
||||
From="0.85"
|
||||
To="1.0"
|
||||
Duration="0:0:0.08" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user