2025-02-10 20:53:40 +08:00
|
|
|
<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:converters="clr-namespace:WPFluent.Converters">
|
|
|
|
|
|
|
|
|
|
<converters:ContentDialogButtonEnumToBoolConverter x:Key="EnumToBoolConverter" />
|
2025-04-24 20:56:44 +08:00
|
|
|
<converters:BooleanToVisConverter x:Key="BooleanToVisConverter" />
|
2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
<CornerRadius x:Key="DialogOverlayCornerRadius">8,8,0,0</CornerRadius>
|
|
|
|
|
<CornerRadius x:Key="DialogFooterCornerRadius">0,0,8,8</CornerRadius>
|
|
|
|
|
|
|
|
|
|
<Style x:Key="DefaultContentDialogStyle" TargetType="{x:Type controls:ContentDialog}">
|
|
|
|
|
<Setter Property="ScrollViewer.CanContentScroll" Value="True" />
|
|
|
|
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
|
|
|
|
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
|
|
|
|
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
|
|
|
|
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
|
|
|
|
<Setter Property="Border.CornerRadius" Value="{DynamicResource PopupCornerRadius}" />
|
|
|
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
|
|
|
<Setter Property="DialogMaxHeight" Value="850" />
|
|
|
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
|
|
|
<Setter Property="Padding" Value="24" />
|
|
|
|
|
<Setter Property="DialogMaxWidth" Value="1000" />
|
|
|
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
|
|
|
<Setter Property="Focusable" Value="True" />
|
|
|
|
|
<Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />
|
|
|
|
|
<Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle" />
|
|
|
|
|
<Setter Property="DialogMargin" Value="35" />
|
|
|
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource ContentDialogForeground}" />
|
|
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ContentDialogBorderBrush}" />
|
|
|
|
|
<Setter Property="Background" Value="{DynamicResource ContentDialogBackground}" />
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type controls:ContentDialog}">
|
|
|
|
|
<Grid Background="{DynamicResource ContentDialogSmokeFill}" Focusable="False">
|
|
|
|
|
|
|
|
|
|
<Border
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
|
|
MaxWidth="{TemplateBinding DialogMaxWidth}"
|
|
|
|
|
MaxHeight="{TemplateBinding DialogMaxHeight}"
|
|
|
|
|
Margin="{TemplateBinding DialogMargin}"
|
|
|
|
|
Background="{TemplateBinding Background}"
|
|
|
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
|
CornerRadius="{TemplateBinding Border.CornerRadius}"
|
|
|
|
|
Focusable="False"
|
|
|
|
|
Opacity="1">
|
|
|
|
|
<Border.Effect>
|
|
|
|
|
<DropShadowEffect
|
|
|
|
|
BlurRadius="30"
|
|
|
|
|
Direction="0"
|
|
|
|
|
Opacity="0.4"
|
|
|
|
|
ShadowDepth="0"
|
|
|
|
|
Color="#202020" />
|
|
|
|
|
</Border.Effect>
|
|
|
|
|
|
|
|
|
|
<Grid Focusable="False">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Border Background="{DynamicResource ContentDialogTopOverlay}" CornerRadius="{StaticResource DialogOverlayCornerRadius}" />
|
|
|
|
|
<Grid
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
Margin="24,10"
|
|
|
|
|
Focusable="False">
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
<ContentPresenter
|
|
|
|
|
Grid.Row="0"
|
|
|
|
|
Margin="0,12,0,0"
|
|
|
|
|
Content="{TemplateBinding Title}"
|
|
|
|
|
ContentTemplate="{TemplateBinding TitleTemplate}"
|
|
|
|
|
TextBlock.FontSize="20"
|
|
|
|
|
TextBlock.FontWeight="SemiBold">
|
|
|
|
|
<ContentPresenter.Resources>
|
|
|
|
|
<Style BasedOn="{StaticResource {x:Type TextBlock}}" TargetType="{x:Type TextBlock}">
|
|
|
|
|
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
|
|
|
|
|
</Style>
|
|
|
|
|
</ContentPresenter.Resources>
|
|
|
|
|
</ContentPresenter>
|
|
|
|
|
|
|
|
|
|
<controls:PassiveScrollViewer
|
|
|
|
|
x:Name="PART_ContentScroll"
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
Margin="0,20"
|
|
|
|
|
Padding="0,0,12,0"
|
|
|
|
|
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
|
|
|
|
|
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
|
|
|
|
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
|
|
|
|
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
|
|
|
|
<ContentPresenter
|
|
|
|
|
Content="{TemplateBinding Content}"
|
|
|
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
|
|
|
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}">
|
|
|
|
|
<ContentPresenter.Resources>
|
|
|
|
|
<Style BasedOn="{StaticResource {x:Type TextBlock}}" TargetType="{x:Type TextBlock}">
|
|
|
|
|
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
|
|
|
|
|
<Setter Property="TextAlignment" Value="Justify" />
|
|
|
|
|
<Setter Property="FontSize" Value="14" />
|
|
|
|
|
</Style>
|
|
|
|
|
</ContentPresenter.Resources>
|
|
|
|
|
</ContentPresenter>
|
|
|
|
|
</controls:PassiveScrollViewer>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<Border
|
|
|
|
|
Grid.Row="1"
|
|
|
|
|
Padding="{TemplateBinding Padding}"
|
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
|
VerticalAlignment="Bottom"
|
|
|
|
|
BorderBrush="{DynamicResource ContentDialogSeparatorBorderBrush}"
|
|
|
|
|
BorderThickness="0,1,0,0"
|
|
|
|
|
CornerRadius="{DynamicResource DialogFooterCornerRadius}"
|
|
|
|
|
Focusable="False"
|
|
|
|
|
Visibility="{TemplateBinding IsFooterVisible,
|
2025-04-24 20:56:44 +08:00
|
|
|
Converter={StaticResource BooleanToVisConverter}}">
|
2025-02-10 20:53:40 +08:00
|
|
|
|
|
|
|
|
<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="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
<controls:Button
|
|
|
|
|
Grid.Column="0"
|
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
|
Appearance="{TemplateBinding PrimaryButtonAppearance}"
|
|
|
|
|
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:ContentDialog}}, Mode=OneTime, Path=TemplateButtonCommand}"
|
|
|
|
|
CommandParameter="{x:Static controls:ContentDialogButton.Primary}"
|
|
|
|
|
Content="{TemplateBinding PrimaryButtonText}"
|
|
|
|
|
Icon="{TemplateBinding PrimaryButtonIcon}"
|
|
|
|
|
IsEnabled="{TemplateBinding IsPrimaryButtonAvailable}"
|
|
|
|
|
IsDefault="{TemplateBinding DefaultButton,
|
|
|
|
|
Converter={StaticResource EnumToBoolConverter},
|
|
|
|
|
ConverterParameter={x:Static controls:ContentDialogButton.Primary}}" />
|
|
|
|
|
|
|
|
|
|
<controls:Button
|
|
|
|
|
Grid.Column="2"
|
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
|
Appearance="{TemplateBinding SecondaryButtonAppearance}"
|
|
|
|
|
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:ContentDialog}}, Mode=OneTime, Path=TemplateButtonCommand}"
|
|
|
|
|
CommandParameter="{x:Static controls:ContentDialogButton.Secondary}"
|
|
|
|
|
Content="{TemplateBinding SecondaryButtonText}"
|
|
|
|
|
Icon="{TemplateBinding SecondaryButtonIcon}"
|
|
|
|
|
IsDefault="{TemplateBinding DefaultButton,
|
|
|
|
|
Converter={StaticResource EnumToBoolConverter},
|
|
|
|
|
ConverterParameter={x:Static controls:ContentDialogButton.Secondary}}" />
|
|
|
|
|
|
|
|
|
|
<controls:Button
|
|
|
|
|
Grid.Column="4"
|
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
|
Appearance="{TemplateBinding CloseButtonAppearance}"
|
|
|
|
|
Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:ContentDialog}}, Mode=OneTime, Path=TemplateButtonCommand}"
|
|
|
|
|
CommandParameter="{x:Static controls:ContentDialogButton.Close}"
|
|
|
|
|
Content="{TemplateBinding CloseButtonText}"
|
|
|
|
|
Icon="{TemplateBinding CloseButtonIcon}"
|
|
|
|
|
IsCancel="True"
|
|
|
|
|
IsDefault="{TemplateBinding DefaultButton,
|
|
|
|
|
Converter={StaticResource EnumToBoolConverter},
|
|
|
|
|
ConverterParameter={x:Static controls:ContentDialogButton.Close}}" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsPrimaryButtonEnabled" Value="False">
|
|
|
|
|
<Setter TargetName="PrimaryColumn" Property="Width" Value="0" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsSecondaryButtonEnabled" Value="False">
|
|
|
|
|
<Setter TargetName="FirstSpacer" Property="Width" Value="0" />
|
|
|
|
|
<Setter TargetName="SecondaryColumn" Property="Width" Value="0" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<MultiTrigger>
|
|
|
|
|
<MultiTrigger.Conditions>
|
|
|
|
|
<Condition Property="IsPrimaryButtonEnabled" Value="False" />
|
|
|
|
|
<Condition Property="IsSecondaryButtonEnabled" Value="False" />
|
|
|
|
|
</MultiTrigger.Conditions>
|
|
|
|
|
<MultiTrigger.Setters>
|
|
|
|
|
<Setter TargetName="SecondSpacer" Property="Width" Value="0" />
|
|
|
|
|
</MultiTrigger.Setters>
|
|
|
|
|
</MultiTrigger>
|
|
|
|
|
<Trigger Property="PrimaryButtonText" Value="">
|
|
|
|
|
<Setter Property="IsPrimaryButtonEnabled" Value="False" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="SecondaryButtonText" Value="">
|
|
|
|
|
<Setter Property="IsSecondaryButtonEnabled" Value="False" />
|
|
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<Style BasedOn="{StaticResource DefaultContentDialogStyle}" TargetType="{x:Type controls:ContentDialog}" />
|
|
|
|
|
|
|
|
|
|
</ResourceDictionary>
|