2025-08-12 23:08:54 +08:00
|
|
|
|
<ResourceDictionary
|
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
xmlns:assists="clr-namespace:Melskin.Assists"
|
|
|
|
|
|
xmlns:controls="clr-namespace:Melskin.Controls"
|
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type Button}" x:Key="WindowNormalButtonTemplate">
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Border
|
|
|
|
|
|
Background="{TemplateBinding Background}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
|
|
x:Name="border">
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<ContentPresenter
|
|
|
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
Margin="{TemplateBinding Padding}"
|
2025-10-10 11:19:58 +08:00
|
|
|
|
RecognizesAccessKey="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
|
x:Name="contentPresenter" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
</Border>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
|
|
|
|
<Condition Property="Background" Value="Transparent" />
|
|
|
|
|
|
</MultiTrigger.Conditions>
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Background" TargetName="border" Value="{DynamicResource BackgroundLayoutBrush}" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<!--<Setter TargetName="border" Property="Effect">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<effects:BrightnessContrastEffect Brightness="0.1" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>-->
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Background" TargetName="border" Value="#1A000000" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Setter Property="Opacity" Value="1" />
|
|
|
|
|
|
</MultiTrigger>
|
|
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
|
|
|
|
|
<!--<Setter TargetName="border" Property="Effect">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<effects:BrightnessContrastEffect Brightness="0.05" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>-->
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Background" TargetName="border" Value="#33000000" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{Binding Path=(assists:ShadingAssist.DisabledForeground), RelativeSource={RelativeSource TemplatedParent}}" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<ControlTemplate TargetType="{x:Type Button}" x:Key="WindowCloseButtonTemplate">
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Border
|
|
|
|
|
|
Background="{TemplateBinding Background}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
|
|
x:Name="border">
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<ContentPresenter
|
|
|
|
|
|
Focusable="False"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
|
Margin="{TemplateBinding Padding}"
|
2025-10-10 11:19:58 +08:00
|
|
|
|
RecognizesAccessKey="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
|
x:Name="contentPresenter" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
</Border>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Background" TargetName="border" Value="#E81123" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Setter Property="Foreground" Value="#e0e0e0" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Setter Property="Background" TargetName="border" Value="#F1707A" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Setter Property="Foreground" Value="#edbebb" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
|
|
|
|
|
<Setter Property="Foreground" Value="{Binding Path=(assists:ShadingAssist.DisabledForeground), RelativeSource={RelativeSource TemplatedParent}}" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
|
</ControlTemplate>
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<!-- 窗口标题按钮 -->
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Style TargetType="{x:Type Button}" x:Key="WindowButton">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
|
|
<Setter Property="Focusable" Value="False" />
|
2025-09-12 09:55:36 +08:00
|
|
|
|
<Setter Property="UseLayoutRounding" Value="True" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="assists:ShadingAssist.DisabledForeground" Value="{DynamicResource TextDisabledBrush}" />
|
|
|
|
|
|
<Setter Property="Background" Value="Transparent" />
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
2025-08-26 21:33:20 +08:00
|
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
2025-09-12 09:55:36 +08:00
|
|
|
|
<!--<Setter Property="WindowChrome.IsHitTestVisibleInChrome" Value="True" />-->
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="Width" Value="46" />
|
|
|
|
|
|
<Setter Property="Height" Value="32" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Setter Property="Template" Value="{StaticResource WindowNormalButtonTemplate}" />
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<Trigger Property="Tag" Value="Close">
|
|
|
|
|
|
<Setter Property="Template" Value="{StaticResource WindowCloseButtonTemplate}" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Style TargetType="{x:Type Button}" x:Key="WindowCloseButton">
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
|
|
<Setter Property="Focusable" Value="False" />
|
|
|
|
|
|
<Setter Property="UseLayoutRounding" Value="True" />
|
|
|
|
|
|
<Setter Property="assists:ShadingAssist.DisabledForeground" Value="{DynamicResource TextDisabledBrush}" />
|
|
|
|
|
|
<Setter Property="Background" Value="Transparent" />
|
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
|
|
|
|
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
|
|
|
|
<Setter Property="Width" Value="46" />
|
|
|
|
|
|
<Setter Property="Height" Value="32" />
|
|
|
|
|
|
<Setter Property="Template" Value="{StaticResource WindowNormalButtonTemplate}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</Style>
|
2025-10-10 11:19:58 +08:00
|
|
|
|
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Style TargetType="{x:Type ResizeGrip}" x:Key="ResizeGripStyle">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="Background" Value="Transparent" />
|
|
|
|
|
|
<Setter Property="Height" Value="18" />
|
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Right" />
|
|
|
|
|
|
<Setter Property="Opacity" Value="0.75" />
|
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type ResizeGrip}">
|
|
|
|
|
|
<Grid
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Background="{TemplateBinding Background}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Height="18"
|
|
|
|
|
|
SnapsToDevicePixels="True"
|
|
|
|
|
|
Width="18">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Grid.Resources>
|
|
|
|
|
|
<Style TargetType="Rectangle">
|
|
|
|
|
|
<!--<Setter Property="Fill" Value="{Binding BorderBackgroundBrush, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" />-->
|
2025-08-25 17:30:53 +08:00
|
|
|
|
<Setter Property="Fill" Value="{DynamicResource TextSecondaryBrush}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="Height" Value="2" />
|
|
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
|
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Top" />
|
|
|
|
|
|
<Setter Property="Width" Value="2" />
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</Grid.Resources>
|
|
|
|
|
|
<Rectangle Margin="14,2,0,0" />
|
|
|
|
|
|
<Rectangle Margin="14,6,0,0" />
|
|
|
|
|
|
<Rectangle Margin="14,10,0,0" />
|
|
|
|
|
|
<Rectangle Margin="14,14,0,0" />
|
|
|
|
|
|
<Rectangle Margin="10,6,0,0" />
|
|
|
|
|
|
<Rectangle Margin="10,10,0,0" />
|
|
|
|
|
|
<Rectangle Margin="10,14,0,0" />
|
|
|
|
|
|
<Rectangle Margin="6,10,0,0" />
|
|
|
|
|
|
<Rectangle Margin="6,14,0,0" />
|
|
|
|
|
|
<Rectangle Margin="2,14,0,0" />
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
<Setter Property="VerticalAlignment" Value="Bottom" />
|
|
|
|
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
|
|
|
|
<Setter Property="Width" Value="18" />
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Path=ResizeMode, RelativeSource={RelativeSource TemplatedParent}}" Value="CanResizeWithGrip">
|
|
|
|
|
|
<Setter Property="Visibility" Value="Visible" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
2026-01-02 17:30:41 +08:00
|
|
|
|
<Style TargetType="controls:MelWindow" x:Key="NeoWindowStyle">
|
2025-08-24 13:49:55 +08:00
|
|
|
|
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Setter Property="MinWidth" Value="300" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="WindowChrome.WindowChrome">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<WindowChrome UseAeroCaptionButtons="False">
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<!--<WindowChrome.ResizeBorderThickness>6</WindowChrome.ResizeBorderThickness>
|
|
|
|
|
|
<WindowChrome.NonClientFrameEdges>Left,Bottom,Right</WindowChrome.NonClientFrameEdges>-->
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</WindowChrome>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
|
<Setter.Value>
|
2026-01-02 17:30:41 +08:00
|
|
|
|
<ControlTemplate TargetType="controls:MelWindow">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<ControlTemplate.Resources>
|
|
|
|
|
|
<!-- 激活窗口后,窗口内容逐渐清晰,不透明度增加到1 -->
|
|
|
|
|
|
<Storyboard x:Key="OpacityInStoryboard">
|
|
|
|
|
|
<DoubleAnimation
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Duration="0:0:0.2"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
From="0.75"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Storyboard.TargetProperty="Opacity"
|
|
|
|
|
|
To="1">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<DoubleAnimation.EasingFunction>
|
|
|
|
|
|
<SineEase EasingMode="EaseOut" />
|
|
|
|
|
|
</DoubleAnimation.EasingFunction>
|
|
|
|
|
|
</DoubleAnimation>
|
|
|
|
|
|
</Storyboard>
|
|
|
|
|
|
<Storyboard x:Key="OpacityOutStoryboard">
|
|
|
|
|
|
<DoubleAnimation
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Duration="0:0:0.2"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
From="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Storyboard.TargetProperty="Opacity"
|
|
|
|
|
|
To="0.75">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<DoubleAnimation.EasingFunction>
|
|
|
|
|
|
<SineEase EasingMode="EaseOut" />
|
|
|
|
|
|
</DoubleAnimation.EasingFunction>
|
|
|
|
|
|
</DoubleAnimation>
|
|
|
|
|
|
</Storyboard>
|
|
|
|
|
|
</ControlTemplate.Resources>
|
|
|
|
|
|
<Border x:Name="windowBorder">
|
|
|
|
|
|
<Border.Style>
|
|
|
|
|
|
<Style TargetType="{x:Type Border}">
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Path=WindowState, RelativeSource={RelativeSource TemplatedParent}}" Value="Normal">
|
|
|
|
|
|
<Setter Property="Padding" Value="0" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Path=WindowState, RelativeSource={RelativeSource TemplatedParent}}" Value="Maximized">
|
|
|
|
|
|
<Setter Property="Padding" Value="8" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</Border.Style>
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Grid Background="{TemplateBinding Background}" x:Name="RootGrid">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
|
<RowDefinition Height="32" />
|
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<!-- 自定义标题栏 -->
|
|
|
|
|
|
<!-- 上方背景 -->
|
|
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Background="{TemplateBinding assists:ColorAssist.TitleBarBackground}"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
Grid.ColumnSpan="3"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="0" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<StackPanel
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Grid.Column="0"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="0"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
Orientation="Horizontal">
|
|
|
|
|
|
<!-- 图标容器 -->
|
|
|
|
|
|
<Image
|
|
|
|
|
|
Margin="10,10,4,4"
|
|
|
|
|
|
Panel.ZIndex="2048"
|
|
|
|
|
|
RenderOptions.BitmapScalingMode="HighQuality"
|
|
|
|
|
|
Source="{TemplateBinding Icon}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Stretch="Uniform"
|
|
|
|
|
|
VerticalAlignment="Center" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 左侧标题栏容器 -->
|
|
|
|
|
|
<ContentControl
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Content="{TemplateBinding TitleBarLeftContent}"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
Margin="0,6,8,0"
|
|
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
|
VerticalContentAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
WindowChrome.IsHitTestVisibleInChrome="True"
|
|
|
|
|
|
x:Name="LeftContent" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
<!-- 标题 -->
|
|
|
|
|
|
<Label
|
|
|
|
|
|
Grid.Column="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="0"
|
|
|
|
|
|
HorizontalAlignment="Left"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
Margin="0,6,0,0"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Padding="12,2">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<TextBlock
|
|
|
|
|
|
FontSize="14"
|
|
|
|
|
|
Foreground="{DynamicResource TextPrimaryBrush}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Text="{TemplateBinding Title}"
|
|
|
|
|
|
x:Name="TitleBlock">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<TextBlock.Style>
|
|
|
|
|
|
<Style TargetType="TextBlock">
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Path=WindowStyle, RelativeSource={RelativeSource TemplatedParent}}" Value="None">
|
|
|
|
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
<MultiDataTrigger>
|
|
|
|
|
|
<MultiDataTrigger.Conditions>
|
|
|
|
|
|
<Condition Binding="{Binding Path=FadeContentIfInactive, RelativeSource={RelativeSource TemplatedParent}}" Value="True" />
|
|
|
|
|
|
<Condition Binding="{Binding Path=IsActive, RelativeSource={RelativeSource TemplatedParent}}" Value="True" />
|
|
|
|
|
|
</MultiDataTrigger.Conditions>
|
|
|
|
|
|
<MultiDataTrigger.EnterActions>
|
|
|
|
|
|
<BeginStoryboard Storyboard="{StaticResource OpacityInStoryboard}" />
|
|
|
|
|
|
</MultiDataTrigger.EnterActions>
|
|
|
|
|
|
<MultiDataTrigger.ExitActions>
|
|
|
|
|
|
<BeginStoryboard Storyboard="{StaticResource OpacityOutStoryboard}" />
|
|
|
|
|
|
</MultiDataTrigger.ExitActions>
|
|
|
|
|
|
</MultiDataTrigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</TextBlock.Style>
|
|
|
|
|
|
</TextBlock>
|
|
|
|
|
|
</Label>
|
|
|
|
|
|
<StackPanel
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Grid.Column="2"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="0"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
HorizontalAlignment="Right"
|
|
|
|
|
|
Orientation="Horizontal"
|
|
|
|
|
|
WindowChrome.IsHitTestVisibleInChrome="True">
|
|
|
|
|
|
<!-- 右侧内容容器 -->
|
|
|
|
|
|
<ContentControl
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Content="{TemplateBinding TitleBarRightContent}"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
|
VerticalContentAlignment="Center"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
WindowChrome.IsHitTestVisibleInChrome="True"
|
|
|
|
|
|
x:Name="RightContent" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<!-- 功能按钮 -->
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Button ToolTip="最小化" x:Name="minimizeButton">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Button.Style>
|
|
|
|
|
|
<Style BasedOn="{StaticResource WindowButton}" TargetType="Button">
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Path=ResizeMode, RelativeSource={RelativeSource AncestorType=Window}}" Value="NoResize">
|
|
|
|
|
|
<Setter Property="IsEnabled" Value="False" />
|
|
|
|
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</Button.Style>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<controls:IconElement
|
|
|
|
|
|
FontSize="24"
|
|
|
|
|
|
Foreground="{Binding ElementName=minimizeButton, Path=Foreground}"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Padding="0,-14,0,0"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
SnapsToDevicePixels="True"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Symbol="Minimize"
|
|
|
|
|
|
UseLayoutRounding="True" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</Button>
|
2026-01-02 17:30:30 +08:00
|
|
|
|
<Button WindowChrome.IsHitTestVisibleInChrome="True" x:Name="maximizeRestoreButton">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Button.Style>
|
|
|
|
|
|
<Style BasedOn="{StaticResource WindowButton}" TargetType="Button">
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Path=WindowState, RelativeSource={RelativeSource TemplatedParent}}" Value="Normal">
|
|
|
|
|
|
<!-- 最大化 -->
|
|
|
|
|
|
<Setter Property="Content">
|
|
|
|
|
|
<Setter.Value>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<controls:IconElement FontSize="20" Symbol="Fullscreen" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
<!-- 提示 -->
|
|
|
|
|
|
<Setter Property="ToolTip" Value="最大化" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Path=WindowState, RelativeSource={RelativeSource TemplatedParent}}" Value="Maximized">
|
|
|
|
|
|
<Setter Property="Content">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<!-- 恢复 -->
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<controls:IconElement FontSize="20" Symbol="FullscreenExit" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
<Setter Property="ToolTip" Value="恢复" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
<!-- 切换显示 -->
|
|
|
|
|
|
<DataTrigger Binding="{Binding Path=ResizeMode, RelativeSource={RelativeSource AncestorType=Window}}" Value="NoResize">
|
|
|
|
|
|
<Setter Property="IsEnabled" Value="False" />
|
|
|
|
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
<DataTrigger Binding="{Binding Path=ResizeMode, RelativeSource={RelativeSource AncestorType=Window}}" Value="CanMinimize">
|
|
|
|
|
|
<Setter Property="IsEnabled" Value="False" />
|
|
|
|
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
|
|
|
|
</DataTrigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</Button.Style>
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Button
|
|
|
|
|
|
ToolTip="关闭"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
WindowChrome.IsHitTestVisibleInChrome="True"
|
|
|
|
|
|
x:Name="closeButton">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Button.Style>
|
|
|
|
|
|
<Style BasedOn="{StaticResource WindowButton}" TargetType="Button">
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Setter Property="Tag" Value="Close" />
|
|
|
|
|
|
<!--<Style.Triggers>
|
2025-09-12 09:55:36 +08:00
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ErrorBrush}" />
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<Setter Property="Foreground" Value="#e0e0e0" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</Trigger>
|
2025-10-10 11:19:58 +08:00
|
|
|
|
<Trigger Property="IsPressed" Value="True">
|
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ErrorPressedBrush}" />
|
|
|
|
|
|
<Setter Property="Foreground" Value="#edbebb" />
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
</Style.Triggers>-->
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</Style>
|
|
|
|
|
|
</Button.Style>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
<controls:IconElement
|
|
|
|
|
|
FontSize="22"
|
|
|
|
|
|
Foreground="{Binding ElementName=closeButton, Path=Foreground}"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
SnapsToDevicePixels="True"
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Symbol="Close"
|
|
|
|
|
|
UseLayoutRounding="True" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</Button>
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
<!-- 窗体内容 -->
|
|
|
|
|
|
<Border
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Background="{TemplateBinding Background}"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
Grid.Column="0"
|
|
|
|
|
|
Grid.ColumnSpan="3"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
|
|
Panel.ZIndex="1000"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
VerticalAlignment="Stretch">
|
2025-08-12 23:08:54 +08:00
|
|
|
|
<AdornerDecorator>
|
|
|
|
|
|
<ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}">
|
|
|
|
|
|
<ContentPresenter.Style>
|
|
|
|
|
|
<Style TargetType="ContentPresenter">
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<MultiDataTrigger>
|
|
|
|
|
|
<MultiDataTrigger.Conditions>
|
|
|
|
|
|
<Condition Binding="{Binding Path=FadeContentIfInactive, RelativeSource={RelativeSource TemplatedParent}}" Value="True" />
|
|
|
|
|
|
<Condition Binding="{Binding Path=IsActive, RelativeSource={RelativeSource TemplatedParent}}" Value="True" />
|
|
|
|
|
|
</MultiDataTrigger.Conditions>
|
|
|
|
|
|
<MultiDataTrigger.EnterActions>
|
|
|
|
|
|
<BeginStoryboard Storyboard="{StaticResource OpacityInStoryboard}" />
|
|
|
|
|
|
</MultiDataTrigger.EnterActions>
|
|
|
|
|
|
<MultiDataTrigger.ExitActions>
|
|
|
|
|
|
<BeginStoryboard Storyboard="{StaticResource OpacityOutStoryboard}" />
|
|
|
|
|
|
</MultiDataTrigger.ExitActions>
|
|
|
|
|
|
</MultiDataTrigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
|
|
|
|
|
</ContentPresenter.Style>
|
|
|
|
|
|
</ContentPresenter>
|
|
|
|
|
|
</AdornerDecorator>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
<ResizeGrip
|
2025-09-08 19:49:09 +08:00
|
|
|
|
Grid.Column="2"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Grid.Row="1"
|
2025-08-12 23:08:54 +08:00
|
|
|
|
Panel.ZIndex="2048"
|
2026-01-02 17:30:30 +08:00
|
|
|
|
Style="{StaticResource ResizeGripStyle}"
|
|
|
|
|
|
x:Name="resizeGrip" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</Grid>
|
|
|
|
|
|
</Border>
|
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
|
<Trigger Property="WindowState" Value="Normal">
|
|
|
|
|
|
<Setter Property="WindowChrome.WindowChrome">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<WindowChrome ResizeBorderThickness="4" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="WindowState" Value="Maximized">
|
|
|
|
|
|
<Setter Property="WindowChrome.WindowChrome">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<WindowChrome ResizeBorderThickness="0" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
<Trigger Property="ResizeMode" Value="CanResizeWithGrip">
|
|
|
|
|
|
<Setter Property="WindowChrome.WindowChrome">
|
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
|
<WindowChrome ResizeBorderThickness="4,4,18,18" />
|
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
|
</Setter>
|
|
|
|
|
|
</Trigger>
|
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
|
</Style>
|
2026-01-02 17:30:41 +08:00
|
|
|
|
<Style BasedOn="{StaticResource NeoWindowStyle}" TargetType="controls:MelWindow" />
|
2025-08-12 23:08:54 +08:00
|
|
|
|
</ResourceDictionary>
|