整理控件库
This commit is contained in:
@@ -1,29 +1,21 @@
|
||||
<!--
|
||||
This Source Code Form is subject to the terms of the MIT License.
|
||||
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
|
||||
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
|
||||
All Rights Reserved.
|
||||
-->
|
||||
|
||||
<ResourceDictionary
|
||||
<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">
|
||||
|
||||
<Style TargetType="{x:Type controls:TitleBarButton}">
|
||||
<Setter Property="Width" Value="44" />
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="MouseOverBackground" Value="{Binding Path=ButtonsBackground, RelativeSource={RelativeSource AncestorType={x:Type controls:TitleBar}}}" />
|
||||
<Setter Property="ButtonsForeground" Value="{Binding Path=ButtonsForeground, RelativeSource={RelativeSource AncestorType={x:Type controls:TitleBar}}}" />
|
||||
<Setter Property="MouseOverButtonsForeground" Value="{Binding Path=MouseOverButtonsForeground, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="Command" Value="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource AncestorType={x:Type controls:TitleBar}}}" />
|
||||
<Setter Property="KeyboardNavigation.IsTabStop" Value="True" />
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
<Setter Property="ButtonsForeground" Value="{Binding Path=ButtonsForeground, RelativeSource={RelativeSource AncestorType={x:Type controls:TitleBar}}}" />
|
||||
<Setter Property="Canvas.ZIndex" Value="1" />
|
||||
<Setter Property="Command" Value="{Binding Path=TemplateButtonCommand, RelativeSource={RelativeSource AncestorType={x:Type controls:TitleBar}}}" />
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="KeyboardNavigation.IsTabStop" Value="True" />
|
||||
<Setter Property="MouseOverBackground" Value="{Binding Path=ButtonsBackground, RelativeSource={RelativeSource AncestorType={x:Type controls:TitleBar}}}" />
|
||||
<Setter Property="MouseOverButtonsForeground" Value="{Binding Path=MouseOverButtonsForeground, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:TitleBarButton}">
|
||||
@@ -48,17 +40,17 @@
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="ButtonType" Value="{x:Static controls:TitleBarButtonType.Help}">
|
||||
<Setter Property="CommandParameter" Value="{x:Static controls:TitleBarButtonType.Help}" />
|
||||
<Setter TargetName="ViewBox" Property="Width" Value="13" />
|
||||
<Setter TargetName="ViewBox" Property="Height" Value="13" />
|
||||
<Setter TargetName="Canvas" Property="Width" Value="24" />
|
||||
<Setter TargetName="Canvas" Property="Height" Value="41" />
|
||||
<Setter TargetName="CanvasPath" Property="Data" Value="M20.56,11.57c0-1.19-.24-2.31-.71-3.36-.47-1.05-1.11-1.96-1.92-2.74-.8-.78-1.74-1.4-2.81-1.85-1.07-.45-2.2-.68-3.37-.68s-2.37,.23-3.44,.69c-1.07,.46-2,1.09-2.8,1.88s-1.42,1.73-1.88,2.8c-.46,1.07-.69,2.22-.69,3.44,0,.4-.15,.74-.44,1.03s-.64,.44-1.03,.44c-.49,0-.86-.17-1.1-.52-.25-.34-.37-.74-.37-1.18,0-1.59,.32-3.09,.95-4.49,.63-1.4,1.49-2.62,2.57-3.66,1.08-1.04,2.33-1.86,3.74-2.47,1.42-.6,2.91-.91,4.49-.91s3.07,.3,4.49,.91c1.42,.6,2.66,1.43,3.74,2.47,1.08,1.04,1.93,2.26,2.57,3.66,.63,1.4,.95,2.9,.95,4.49,0,1.24-.13,2.32-.39,3.25-.26,.93-.63,1.77-1.12,2.54-.49,.77-1.08,1.49-1.78,2.18-.7,.69-1.48,1.42-2.35,2.2-.44,.4-.88,.78-1.31,1.16-.43,.38-.84,.78-1.24,1.21-.5,.55-.89,1.08-1.17,1.59-.28,.51-.48,1.03-.62,1.56-.14,.53-.22,1.09-.25,1.69-.03,.6-.05,1.25-.05,1.95,0,.4-.15,.74-.44,1.03-.29,.29-.64,.44-1.03,.44-.34,0-.6-.06-.79-.18-.19-.12-.34-.29-.44-.49-.1-.21-.17-.44-.2-.7-.03-.26-.05-.52-.05-.78v-.78c0-1.21,.15-2.28,.44-3.2,.29-.93,.68-1.76,1.16-2.5,.48-.74,1.03-1.41,1.65-2.02,.62-.6,1.25-1.19,1.89-1.74,.64-.56,1.27-1.11,1.88-1.66,.61-.55,1.16-1.15,1.64-1.8,.48-.65,.87-1.37,1.17-2.16,.3-.79,.45-1.69,.45-2.72Zm-11.02,27.36c0-.61,.21-1.13,.64-1.56,.43-.43,.95-.64,1.56-.64s1.13,.21,1.56,.64c.43,.43,.64,.95,.64,1.56s-.21,1.13-.64,1.56c-.43,.43-.95,.64-1.56,.64s-1.13-.21-1.56-.64c-.43-.43-.64-.95-.64-1.56Z" />
|
||||
<Setter TargetName="ViewBox" Property="Height" Value="13" />
|
||||
<Setter TargetName="Canvas" Property="Height" Value="41" />
|
||||
<Setter TargetName="ViewBox" Property="Width" Value="13" />
|
||||
<Setter TargetName="Canvas" Property="Width" Value="24" />
|
||||
</Trigger>
|
||||
<Trigger Property="ButtonType" Value="{x:Static controls:TitleBarButtonType.Minimize}">
|
||||
<Setter Property="CommandParameter" Value="{x:Static controls:TitleBarButtonType.Minimize}" />
|
||||
<Setter TargetName="Canvas" Property="Width" Value="72" />
|
||||
<Setter TargetName="Canvas" Property="Height" Value="8" />
|
||||
<Setter TargetName="CanvasPath" Property="Data" Value="M3.59,7.21A3.56,3.56,0,0,1,2.2,6.93a3.66,3.66,0,0,1-1.15-.78A3.88,3.88,0,0,1,.28,5,3.42,3.42,0,0,1,0,3.62,3.45,3.45,0,0,1,.28,2.23a4.12,4.12,0,0,1,.77-1.16A3.52,3.52,0,0,1,2.2.28,3.39,3.39,0,0,1,3.59,0H68.41A3.39,3.39,0,0,1,69.8.28,3.52,3.52,0,0,1,71,1.07a4.12,4.12,0,0,1,.77,1.16A3.45,3.45,0,0,1,72,3.62,3.42,3.42,0,0,1,71.72,5,3.88,3.88,0,0,1,71,6.15a3.66,3.66,0,0,1-1.15.78,3.56,3.56,0,0,1-1.39.28Z" />
|
||||
<Setter TargetName="Canvas" Property="Height" Value="8" />
|
||||
<Setter TargetName="Canvas" Property="Width" Value="72" />
|
||||
</Trigger>
|
||||
<Trigger Property="ButtonType" Value="{x:Static controls:TitleBarButtonType.Restore}">
|
||||
<Setter Property="CommandParameter" Value="{x:Static controls:TitleBarButtonType.Restore}" />
|
||||
@@ -76,27 +68,24 @@
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Width" Value="44" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type controls:TitleBar}">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource WindowBackground}" />
|
||||
<Setter Property="ButtonsBackground" Value="#1A000000" />
|
||||
<Setter Property="ButtonsForeground" Value="{DynamicResource ButtonForeground}" />
|
||||
<Setter Property="ButtonsBackground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#1A000000" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="Padding" Value="16,4,16,4" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="Height" Value="48" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource WindowForeground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
|
||||
<!--<Setter Property="Height" Value="30" />-->
|
||||
<!--<Setter Property="Height" Value="48" />-->
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="Padding" Value="16,4" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:TitleBar}">
|
||||
@@ -104,12 +93,11 @@
|
||||
x:Name="PART_MainGrid"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Background="{TemplateBinding Background}">
|
||||
Background="{DynamicResource WindowBackground}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid
|
||||
x:Name="TitleGrid"
|
||||
Grid.Column="0"
|
||||
@@ -121,34 +109,46 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Custom application icon -->
|
||||
<!-- 自定义应用程序图标 -->
|
||||
<ContentPresenter
|
||||
x:Name="PART_Icon"
|
||||
Grid.Column="0"
|
||||
Height="16"
|
||||
Margin="0,0,12,0"
|
||||
VerticalAlignment="Center"
|
||||
Margin="12,0"
|
||||
Content="{TemplateBinding Icon}"
|
||||
Focusable="False"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" />
|
||||
|
||||
<!-- Title text or other header content -->
|
||||
<ContentPresenter
|
||||
|
||||
<!-- 标题文字或其它内容 -->
|
||||
<!--<ContentPresenter
|
||||
x:Name="PART_TitleBlock"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
Content="{TemplateBinding Header}" />
|
||||
Margin="12,0"
|
||||
Content="{Binding Title,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window}}"
|
||||
TextElement.Foreground="{DynamicResource WindowForeground}" />-->
|
||||
<ContentPresenter
|
||||
x:Name="PART_TitleBlock"
|
||||
Grid.Column="1"
|
||||
Margin="12,0"
|
||||
Content="{TemplateBinding Title}" TextElement.Foreground="{DynamicResource WindowForeground}"/>
|
||||
<!--<TextBlock
|
||||
Grid.Column="1"
|
||||
Height="16"
|
||||
VerticalAlignment="Center"
|
||||
Text="{TemplateBinding Header}"/>-->
|
||||
</Grid>
|
||||
|
||||
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Additional header content -->
|
||||
<!-- 右侧的附加内容 -->
|
||||
<ContentPresenter
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding TrailingContent}" />
|
||||
|
||||
<!-- Navigation buttons - Close, Restore, Maximize, Minimize -->
|
||||
@@ -161,7 +161,6 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<controls:TitleBarButton
|
||||
@@ -177,12 +176,12 @@
|
||||
<controls:TitleBarButton
|
||||
x:Name="PART_MaximizeButton"
|
||||
Grid.Column="2"
|
||||
ButtonType="Maximize"
|
||||
IsHitTestVisible="False"/>
|
||||
ButtonType="Maximize"
|
||||
IsHitTestVisible="False" />
|
||||
|
||||
<controls:TitleBarButton
|
||||
x:Name="PART_CloseButton"
|
||||
Grid.Column="4"
|
||||
Grid.Column="3"
|
||||
ButtonType="Close"
|
||||
MouseOverBackground="{DynamicResource PaletteRedBrush}"
|
||||
MouseOverButtonsForeground="White" />
|
||||
@@ -197,16 +196,9 @@
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="TitleGrid" Property="Visibility" Value="Collapsed" />
|
||||
</MultiTrigger>
|
||||
<Trigger Property="ApplicationTheme" Value="Dark">
|
||||
<Setter Property="ButtonsBackground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#17FFFFFF" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
|
||||
<Setter TargetName="PART_Icon" Property="Margin" Value="0" />
|
||||
<Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
@@ -232,6 +224,10 @@
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user