This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -1,21 +1,14 @@
<!--
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">
xmlns:controls="clr-namespace:WPFluent.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type controls:MessageWindow}">
<Setter Property="MaxWidth" Value="450" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{DynamicResource MessageBoxBackground}" />
<Setter Property="Background" Value="{DynamicResource SolidBackgroundFillColorBaseBrush}" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="{DynamicResource MessageBoxForeground}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="TextElement.FontWeight" Value="Regular" />
<Setter Property="WindowStyle" Value="ToolWindow" />
<Setter Property="ShowInTaskbar" Value="False" />
@@ -52,14 +45,14 @@
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border Grid.RowSpan="2" Background="{DynamicResource MessageBoxTopOverlay}" />
<Border Background="{DynamicResource LayerFillColorAltBrush}" Grid.RowSpan="2" />
<TextBlock
x:Name="Title"
Grid.Row="0"
Margin="12,12,12,0"
FontWeight="SemiBold"
Foreground="{TemplateBinding Foreground}"
Text="{TemplateBinding Title}" />
Grid.Row="0"
Margin="12,12,12,0"
Text="{TemplateBinding Title}"
x:Name="Title" />
<controls:TitleBar
Grid.Row="0"
@@ -67,12 +60,12 @@
ShowMinimize="False" />
<ContentPresenter
x:Name="ContentPresenter"
Grid.Row="1"
Margin="12,10,12,12"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}">
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
Grid.Row="1"
Margin="12,10,12,12"
x:Name="ContentPresenter">
<ContentPresenter.Resources>
<Style BasedOn="{StaticResource {x:Type TextBlock}}" TargetType="{x:Type TextBlock}">
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
@@ -82,48 +75,48 @@
</ContentPresenter>
<Border
Grid.Row="2"
Padding="12"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
BorderBrush="{DynamicResource MessageBoxSeparatorBorderBrush}"
BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0"
CornerRadius="0">
CornerRadius="0"
Grid.Row="2"
HorizontalAlignment="Stretch"
Padding="12"
VerticalAlignment="Bottom">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="PrimaryColumn" Width="*" />
<ColumnDefinition x:Name="FirstSpacer" Width="8" />
<ColumnDefinition x:Name="SecondaryColumn" Width="*" />
<ColumnDefinition x:Name="SecondSpacer" Width="8" />
<ColumnDefinition x:Name="CloseColumn" Width="*" />
<ColumnDefinition Width="*" x:Name="PrimaryColumn" />
<ColumnDefinition Width="8" x:Name="FirstSpacer" />
<ColumnDefinition Width="*" x:Name="SecondaryColumn" />
<ColumnDefinition Width="8" x:Name="SecondSpacer" />
<ColumnDefinition Width="*" x:Name="CloseColumn" />
</Grid.ColumnDefinitions>
<controls:Button
Grid.Column="0"
HorizontalAlignment="Stretch"
Appearance="{TemplateBinding PrimaryButtonAppearance}"
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:MessageWindow}}, Path=TemplateButtonCommand, Mode=OneTime}"
CommandParameter="{x:Static controls:MessageBoxButton.Primary}"
Content="{TemplateBinding PrimaryButtonText}"
Grid.Column="0"
HorizontalAlignment="Stretch"
Icon="{TemplateBinding PrimaryButtonIcon}"
IsDefault="True" />
<controls:Button
Appearance="{TemplateBinding AccentButtonAppearance}"
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:MessageWindow}}, Path=TemplateButtonCommand, Mode=OneTime}"
CommandParameter="{x:Static controls:MessageBoxButton.Accent}"
Content="{TemplateBinding AccentButtonText}"
Grid.Column="2"
HorizontalAlignment="Stretch"
Appearance="{TemplateBinding SecondaryButtonAppearance}"
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:MessageWindow}}, Path=TemplateButtonCommand, Mode=OneTime}"
CommandParameter="{x:Static controls:MessageBoxButton.Secondary}"
Content="{TemplateBinding SecondaryButtonText}"
Icon="{TemplateBinding SecondaryButtonIcon}" />
Icon="{TemplateBinding AccentButtonIcon}" />
<controls:Button
Grid.Column="4"
HorizontalAlignment="Stretch"
Appearance="{TemplateBinding CloseButtonAppearance}"
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:MessageWindow}}, Path=TemplateButtonCommand, Mode=OneTime}"
CommandParameter="{x:Static controls:MessageBoxButton.Close}"
Content="{TemplateBinding CloseButtonText}"
Grid.Column="4"
HorizontalAlignment="Stretch"
Icon="{TemplateBinding CloseButtonIcon}"
IsCancel="True" />
</Grid>
@@ -133,29 +126,29 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="WindowState" Value="Maximized">
<Setter TargetName="ContentPresenter" Property="Margin" Value="8" />
<Setter Property="Margin" TargetName="ContentPresenter" Value="8" />
</Trigger>
<Trigger Property="IsPrimaryButtonEnabled" Value="False">
<Setter TargetName="PrimaryColumn" Property="Width" Value="0" />
<Setter Property="Width" TargetName="PrimaryColumn" Value="0" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsPrimaryButtonEnabled" Value="False" />
<Condition Property="IsSecondaryButtonEnabled" Value="False" />
<Condition Property="IsAccentButtonEnabled" Value="False" />
</MultiTrigger.Conditions>
<MultiTrigger.Setters>
<Setter TargetName="SecondSpacer" Property="Width" Value="0" />
<Setter Property="Width" TargetName="SecondSpacer" Value="0" />
</MultiTrigger.Setters>
</MultiTrigger>
<Trigger Property="IsSecondaryButtonEnabled" Value="False">
<Setter TargetName="FirstSpacer" Property="Width" Value="0" />
<Setter TargetName="SecondaryColumn" Property="Width" Value="0" />
<Trigger Property="IsAccentButtonEnabled" Value="False">
<Setter Property="Width" TargetName="FirstSpacer" Value="0" />
<Setter Property="Width" TargetName="SecondaryColumn" Value="0" />
</Trigger>
<Trigger Property="PrimaryButtonText" Value="">
<Setter Property="IsPrimaryButtonEnabled" Value="False" />
</Trigger>
<Trigger Property="SecondaryButtonText" Value="">
<Setter Property="IsSecondaryButtonEnabled" Value="False" />
<Trigger Property="AccentButtonText" Value="">
<Setter Property="IsAccentButtonEnabled" Value="False" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>