You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
5.6 KiB
120 lines
5.6 KiB
<Window x:Class="AIK.Views.MenuPages.CommonPage.DialogWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:local="clr-namespace:AIK.Views.MenuPages.CommonPage"
|
|
mc:Ignorable="d"
|
|
Title="DialogWindow" Height="400" Width="600"
|
|
WindowStartupLocation="CenterScreen"
|
|
ShowInTaskbar="False"
|
|
ResizeMode="NoResize"
|
|
Background="White"
|
|
WindowStyle="None">
|
|
<Window.Resources>
|
|
<!-- 关闭按钮样式 -->
|
|
<Style x:Key="CloseButtonStyle" TargetType="Button">
|
|
<Setter Property="Width" Value="32"/>
|
|
<Setter Property="Height" Value="32"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Foreground" Value="#999999"/>
|
|
<Setter Property="FontSize" Value="16"/>
|
|
<Setter Property="FontWeight" Value="Bold"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border x:Name="border"
|
|
Width="32" Height="32" CornerRadius="16"
|
|
Background="{TemplateBinding Background}"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="border" Property="Background" Value="#E0E0E0"/>
|
|
<Setter Property="Foreground" Value="#333333"/>
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter TargetName="border" Property="Background" Value="#FF5252"/>
|
|
<Setter Property="Foreground" Value="White"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</Window.Resources>
|
|
<Grid>
|
|
<!-- 主容器:带阴影的圆角卡片 -->
|
|
<Border Background="White"
|
|
CornerRadius="20"
|
|
BorderThickness="1"
|
|
BorderBrush="#DDDDDD"
|
|
Margin="15">
|
|
<Border.Effect>
|
|
<DropShadowEffect BlurRadius="16" ShadowDepth="4" Direction="270" Opacity="0.2" Color="#000000"/>
|
|
</Border.Effect>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<!-- Header -->
|
|
<RowDefinition Height="*"/>
|
|
<!-- Content (可伸缩) -->
|
|
<RowDefinition Height="Auto"/>
|
|
<!-- Footer -->
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- 🔷 顶部标题栏:白色背景 -->
|
|
<Border Grid.Row="0"
|
|
Background="White"
|
|
Padding="20,15"
|
|
CornerRadius="20,20,0,0">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
|
<Image Source="pack://application:,,,/AIK.Assets;component/Images/AIK.png" Width="200" Height="45"></Image>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- 🟨 中间内容区:浅灰色背景 -->
|
|
<Border Grid.Row="1" Background="#F5F5F5" Padding="20">
|
|
<StackPanel>
|
|
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
|
<TextBlock Text="{Binding IconPath}" FontSize="32" FontFamily="{StaticResource Iconfont}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,10" Foreground="{Binding IconForeground}"/>
|
|
<TextBlock Text="{Binding Title}"
|
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
FontSize="24"
|
|
FontWeight="SemiBold"
|
|
Foreground="#333333"
|
|
TextAlignment="Center"
|
|
Margin="0,0,0,10"/>
|
|
</StackPanel>
|
|
<Rectangle Height="1" Fill="#EEEEEE" Margin="0,0,0,15"/>
|
|
<!-- 消息文本 -->
|
|
<TextBlock Text="{Binding Message}"
|
|
FontSize="18"
|
|
Foreground="#333333"
|
|
TextWrapping="Wrap"
|
|
TextAlignment="Center"
|
|
Margin="0,0,0,20"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<!-- ⬜ 底部区域:白色背景(当前留空,可加“取消”按钮等) -->
|
|
<Border Grid.Row="2"
|
|
Background="White"
|
|
Padding="20"
|
|
CornerRadius="0,0,20,20">
|
|
<!-- 例如:<Button Content="取消" HorizontalAlignment="Center"/> -->
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- 关闭按钮:置于卡片右上角 -->
|
|
<Button Content="×"
|
|
Style="{StaticResource CloseButtonStyle}"
|
|
Click="CloseButton_Click"
|
|
HorizontalAlignment="Right"
|
|
VerticalAlignment="Top"
|
|
Margin="0,15,15,0"/>
|
|
</Grid>
|
|
</Window>
|
|
|