Files
Shrlalgo.RvKits/NeoUI/Melskin/Controls/Modal/ModalWindow.xaml

103 lines
4.0 KiB
Plaintext
Raw Normal View History

2025-08-12 23:08:54 +08:00
<Window
2025-12-23 21:35:54 +08:00
AllowsTransparency="True"
Background="Transparent"
2026-01-02 17:30:30 +08:00
Height="220"
Title="Modal"
Width="400"
2025-12-23 21:35:54 +08:00
WindowStartupLocation="CenterOwner"
WindowStyle="None"
2026-01-02 17:30:30 +08:00
mc:Ignorable="d"
x:Class="VariaStudio.Controls.ModalWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
2025-08-12 23:08:54 +08:00
<Window.Resources>
2026-01-02 17:30:30 +08:00
<Style TargetType="Button" x:Key="ModalButtonStyle">
2025-08-12 23:08:54 +08:00
<Setter Property="Padding" Value="10,5" />
<Setter Property="MinWidth" Value="70" />
2025-12-23 21:35:54 +08:00
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<Setter Property="Background" Value="{DynamicResource BackgroundFloatingBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderCornerLightedGradientBrush}" />
2025-08-12 23:08:54 +08:00
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4">
2025-08-20 12:10:13 +08:00
<ContentPresenter
2025-12-23 21:35:54 +08:00
HorizontalAlignment="Center"
2026-01-02 17:30:30 +08:00
Margin="{TemplateBinding Padding}"
2025-08-20 12:10:13 +08:00
VerticalAlignment="Center" />
2025-08-12 23:08:54 +08:00
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E0E0E0" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#D0D0D0" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Border
Background="{DynamicResource BackgroundFloatingBrush}"
BorderBrush="{DynamicResource BorderNormalBrush}"
2025-08-12 23:08:54 +08:00
BorderThickness="1"
CornerRadius="8">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Title -->
<TextBlock
2025-12-23 21:35:54 +08:00
FontSize="16"
FontWeight="SemiBold"
Foreground="{DynamicResource TextPrimaryBrush}"
2026-01-02 17:30:30 +08:00
Grid.Row="0"
Margin="15,10"
Text="Dialog Title"
x:Name="TitleTextBlock" />
2025-08-12 23:08:54 +08:00
<!-- Content -->
<TextBlock
2026-01-02 17:30:30 +08:00
Foreground="{DynamicResource TextPrimaryBrush}"
2025-08-12 23:08:54 +08:00
Grid.Row="1"
Margin="15,10"
2025-12-23 21:35:54 +08:00
Text="This is the modal content."
2026-01-02 17:30:30 +08:00
TextWrapping="Wrap"
VerticalAlignment="Center"
x:Name="MessageTextBlock" />
2025-08-12 23:08:54 +08:00
<!-- Buttons -->
<StackPanel
Grid.Row="2"
2025-12-23 21:35:54 +08:00
HorizontalAlignment="Right"
2026-01-02 17:30:30 +08:00
Margin="15,10"
2025-08-12 23:08:54 +08:00
Orientation="Horizontal">
<Button
Click="CancelButton_Click"
Content="取消"
2026-01-02 17:30:30 +08:00
Style="{StaticResource ModalButtonStyle}"
x:Name="CancelButton" />
2025-08-12 23:08:54 +08:00
<Button
Click="OkButton_Click"
Content="确定"
2025-08-12 23:08:54 +08:00
IsDefault="True"
2026-01-02 17:30:30 +08:00
Margin="10,0,0,0"
Style="{StaticResource ModalButtonStyle}"
x:Name="OkButton" />
2025-08-12 23:08:54 +08:00
</StackPanel>
</Grid>
</Border>
</Window>