维护更新

This commit is contained in:
GG Z
2026-02-17 22:17:23 +08:00
parent b3479d1f39
commit 3816edbdb4
72 changed files with 272 additions and 2976 deletions

View File

@@ -1,21 +1,21 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
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">
xmlns:controls="clr-namespace:Melskin.Controls">
<ControlTemplate x:Key="WindowNormalButtonTemplate" TargetType="{x:Type Button}">
<Border
x:Name="border"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True"
x:Name="border">
SnapsToDevicePixels="True">
<ContentPresenter
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="contentPresenter" />
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
@@ -23,13 +23,13 @@
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="Background" Value="Transparent" />
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="border" Value="{DynamicResource BackgroundLayoutBrush}" />
<Setter TargetName="border" Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
<!--<Setter TargetName="border" Property="Effect">
<Setter.Value>
<effects:BrightnessContrastEffect Brightness="0.1" />
</Setter.Value>
</Setter>-->
<Setter Property="Background" TargetName="border" Value="#1A000000" />
<Setter TargetName="border" Property="Background" Value="#1A000000" />
<Setter Property="Opacity" Value="1" />
</MultiTrigger>
<Trigger Property="IsPressed" Value="True">
@@ -38,35 +38,35 @@
<effects:BrightnessContrastEffect Brightness="0.05" />
</Setter.Value>
</Setter>-->
<Setter Property="Background" TargetName="border" Value="#33000000" />
<Setter TargetName="border" Property="Background" Value="#33000000" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{Binding Path=(assists:ShadingAssist.DisabledForeground), RelativeSource={RelativeSource TemplatedParent}}" />
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{Binding Path=(assists:ShadingAssist.DisabledForeground), RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate TargetType="{x:Type Button}" x:Key="WindowCloseButtonTemplate">
<ControlTemplate x:Key="WindowCloseButtonTemplate" TargetType="{x:Type Button}">
<Border
x:Name="border"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True"
x:Name="border">
SnapsToDevicePixels="True">
<ContentPresenter
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="contentPresenter" />
Focusable="False"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" TargetName="border" Value="#E81123" />
<Setter TargetName="border" Property="Background" Value="#E81123" />
<Setter Property="Foreground" Value="#e0e0e0" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="border" Value="#F1707A" />
<Setter TargetName="border" Property="Background" Value="#F1707A" />
<Setter Property="Foreground" Value="#edbebb" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
@@ -76,7 +76,7 @@
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- 窗口标题按钮 -->
<Style TargetType="{x:Type Button}" x:Key="WindowButton">
<Style x:Key="WindowButton" TargetType="{x:Type Button}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Focusable" Value="False" />
<Setter Property="UseLayoutRounding" Value="True" />
@@ -98,7 +98,7 @@
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type Button}" x:Key="WindowCloseButton">
<Style x:Key="WindowCloseButton" TargetType="{x:Type Button}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Focusable" Value="False" />
<Setter Property="UseLayoutRounding" Value="True" />
@@ -115,7 +115,7 @@
<Setter Property="Template" Value="{StaticResource WindowNormalButtonTemplate}" />
</Style>
<Style TargetType="{x:Type ResizeGrip}" x:Key="ResizeGripStyle">
<Style x:Key="ResizeGripStyle" TargetType="{x:Type ResizeGrip}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Height" Value="18" />
<Setter Property="HorizontalAlignment" Value="Right" />
@@ -124,10 +124,10 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type ResizeGrip}">
<Grid
Background="{TemplateBinding Background}"
Width="18"
Height="18"
SnapsToDevicePixels="True"
Width="18">
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True">
<Grid.Resources>
<Style TargetType="Rectangle">
<!--<Setter Property="Fill" Value="{Binding BorderBackgroundBrush, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" />-->
@@ -163,12 +163,12 @@
</Style.Triggers>
</Style>
<Style TargetType="controls:MelWindow" x:Key="NeoWindowStyle">
<Style x:Key="NeoWindowStyle" TargetType="controls:MelWindow">
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
<Setter Property="MinWidth" Value="300" />
<Setter Property="WindowChrome.WindowChrome">
<Setter.Value>
<WindowChrome UseAeroCaptionButtons="False">
<WindowChrome CaptionHeight="32" UseAeroCaptionButtons="True">
<!--<WindowChrome.ResizeBorderThickness>6</WindowChrome.ResizeBorderThickness>
<WindowChrome.NonClientFrameEdges>Left,Bottom,Right</WindowChrome.NonClientFrameEdges>-->
</WindowChrome>
@@ -181,10 +181,10 @@
<!-- 激活窗口后窗口内容逐渐清晰不透明度增加到1 -->
<Storyboard x:Key="OpacityInStoryboard">
<DoubleAnimation
Duration="0:0:0.2"
From="0.75"
Storyboard.TargetProperty="Opacity"
To="1">
From="0.75"
To="1"
Duration="0:0:0.2">
<DoubleAnimation.EasingFunction>
<SineEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
@@ -192,10 +192,10 @@
</Storyboard>
<Storyboard x:Key="OpacityOutStoryboard">
<DoubleAnimation
Duration="0:0:0.2"
From="1"
Storyboard.TargetProperty="Opacity"
To="0.75">
From="1"
To="0.75"
Duration="0:0:0.2">
<DoubleAnimation.EasingFunction>
<SineEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
@@ -215,7 +215,7 @@
</Style.Triggers>
</Style>
</Border.Style>
<Grid Background="{TemplateBinding Background}" x:Name="RootGrid">
<Grid x:Name="RootGrid" Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition Height="32" />
<RowDefinition Height="*" />
@@ -228,45 +228,45 @@
<!-- 自定义标题栏 -->
<!-- 上方背景 -->
<Border
Background="{TemplateBinding assists:ColorAssist.TitleBarBackground}"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="3"
Grid.Row="0" />
Background="{TemplateBinding assists:ColorAssist.TitleBarBackground}" />
<StackPanel
Grid.Column="0"
Grid.Row="0"
Grid.Column="0"
Orientation="Horizontal">
<!-- 图标容器 -->
<Image
Margin="10,10,4,4"
VerticalAlignment="Center"
Panel.ZIndex="2048"
RenderOptions.BitmapScalingMode="HighQuality"
Source="{TemplateBinding Icon}"
Stretch="Uniform"
VerticalAlignment="Center" />
Stretch="Uniform" />
<!-- 左侧标题栏容器 -->
<ContentControl
Content="{TemplateBinding TitleBarLeftContent}"
x:Name="LeftContent"
Margin="0,6,8,0"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
WindowChrome.IsHitTestVisibleInChrome="True"
x:Name="LeftContent" />
Content="{TemplateBinding TitleBarLeftContent}"
WindowChrome.IsHitTestVisibleInChrome="True" />
</StackPanel>
<!-- 标题 -->
<Label
Grid.Column="1"
Grid.Row="0"
HorizontalAlignment="Left"
Grid.Column="1"
Margin="0,6,0,0"
Padding="12,2">
Padding="12,2"
HorizontalAlignment="Left">
<TextBlock
x:Name="TitleBlock"
FontSize="14"
Foreground="{DynamicResource TextPrimaryBrush}"
Text="{TemplateBinding Title}"
x:Name="TitleBlock">
Text="{TemplateBinding Title}">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
@@ -291,20 +291,20 @@
</TextBlock>
</Label>
<StackPanel
Grid.Column="2"
Grid.Row="0"
Grid.Column="2"
HorizontalAlignment="Right"
Orientation="Horizontal"
WindowChrome.IsHitTestVisibleInChrome="True">
<!-- 右侧内容容器 -->
<ContentControl
Content="{TemplateBinding TitleBarRightContent}"
x:Name="RightContent"
VerticalAlignment="Center"
VerticalContentAlignment="Center"
WindowChrome.IsHitTestVisibleInChrome="True"
x:Name="RightContent" />
Content="{TemplateBinding TitleBarRightContent}"
WindowChrome.IsHitTestVisibleInChrome="True" />
<!-- 功能按钮 -->
<Button ToolTip="最小化" x:Name="minimizeButton">
<Button x:Name="minimizeButton" ToolTip="最小化">
<Button.Style>
<Style BasedOn="{StaticResource WindowButton}" TargetType="Button">
<Style.Triggers>
@@ -316,14 +316,14 @@
</Style>
</Button.Style>
<controls:IconElement
Padding="0,-14,0,0"
FontSize="24"
Foreground="{Binding ElementName=minimizeButton, Path=Foreground}"
Padding="0,-14,0,0"
SnapsToDevicePixels="True"
Symbol="Minimize"
UseLayoutRounding="True" />
</Button>
<Button WindowChrome.IsHitTestVisibleInChrome="True" x:Name="maximizeRestoreButton">
<Button x:Name="maximizeRestoreButton">
<Button.Style>
<Style BasedOn="{StaticResource WindowButton}" TargetType="Button">
<Style.Triggers>
@@ -335,7 +335,7 @@
</Setter.Value>
</Setter>
<!-- 提示 -->
<Setter Property="ToolTip" Value="最大化" />
<!--<Setter Property="ToolTip" Value="最大化" />-->
</DataTrigger>
<DataTrigger Binding="{Binding Path=WindowState, RelativeSource={RelativeSource TemplatedParent}}" Value="Maximized">
<Setter Property="Content">
@@ -344,7 +344,7 @@
<controls:IconElement FontSize="20" Symbol="FullscreenExit" />
</Setter.Value>
</Setter>
<Setter Property="ToolTip" Value="恢复" />
<!--<Setter Property="ToolTip" Value="恢复" />-->
</DataTrigger>
<!-- 切换显示 -->
<DataTrigger Binding="{Binding Path=ResizeMode, RelativeSource={RelativeSource AncestorType=Window}}" Value="NoResize">
@@ -361,9 +361,9 @@
</Button>
<Button
x:Name="closeButton"
ToolTip="关闭"
WindowChrome.IsHitTestVisibleInChrome="True"
x:Name="closeButton">
WindowChrome.IsHitTestVisibleInChrome="True">
<Button.Style>
<Style BasedOn="{StaticResource WindowButton}" TargetType="Button">
<Setter Property="Tag" Value="Close" />
@@ -389,13 +389,13 @@
</StackPanel>
<!-- 窗体内容 -->
<Border
Background="{TemplateBinding Background}"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="3"
Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Panel.ZIndex="1000"
VerticalAlignment="Stretch">
Background="{TemplateBinding Background}">
<AdornerDecorator>
<ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}">
<ContentPresenter.Style>
@@ -420,11 +420,11 @@
</AdornerDecorator>
</Border>
<ResizeGrip
Grid.Column="2"
x:Name="resizeGrip"
Grid.Row="1"
Grid.Column="2"
Panel.ZIndex="2048"
Style="{StaticResource ResizeGripStyle}"
x:Name="resizeGrip" />
Style="{StaticResource ResizeGripStyle}" />
</Grid>
</Border>
</ControlTemplate>