2025-08-12 23:08:54 +08:00
|
|
|
<Window
|
|
|
|
|
AllowsTransparency="True"
|
|
|
|
|
Background="Transparent"
|
2026-01-02 17:30:30 +08:00
|
|
|
Height="Auto"
|
2025-08-12 23:08:54 +08:00
|
|
|
ShowInTaskbar="False"
|
|
|
|
|
SizeToContent="Height"
|
2026-01-02 17:30:30 +08:00
|
|
|
Title="NotificationWindow"
|
2025-08-12 23:08:54 +08:00
|
|
|
Topmost="True"
|
2026-01-02 17:30:30 +08:00
|
|
|
Width="384"
|
2025-08-12 23:08:54 +08:00
|
|
|
WindowStyle="None"
|
2026-01-02 17:30:30 +08:00
|
|
|
mc:Ignorable="d"
|
2026-01-02 17:30:41 +08:00
|
|
|
x:Class="Melskin.Controls.NotificationView"
|
2026-01-02 17:30:30 +08:00
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2026-01-02 17:30:41 +08:00
|
|
|
xmlns:controls="clr-namespace:Melskin.Controls"
|
2026-01-02 17:30:30 +08:00
|
|
|
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-09-08 19:49:09 +08:00
|
|
|
|
2025-08-12 23:08:54 +08:00
|
|
|
<Grid>
|
2025-09-04 22:39:00 +08:00
|
|
|
<Border
|
2025-08-26 21:33:20 +08:00
|
|
|
Background="{DynamicResource BackgroundFloatingBrush}"
|
2025-08-12 23:08:54 +08:00
|
|
|
BorderThickness="1"
|
2026-01-02 17:30:30 +08:00
|
|
|
CornerRadius="4"
|
|
|
|
|
Margin="8"
|
|
|
|
|
x:Name="RootBorder">
|
2025-08-12 23:08:54 +08:00
|
|
|
<!--<controls:Card.Effect>
|
|
|
|
|
<DropShadowEffect ShadowDepth="0" BlurRadius="10" Color="#000000" Opacity="0.1"/>
|
|
|
|
|
</controls:Card.Effect>-->
|
|
|
|
|
<!--<controls:Alert Message="{Binding Title}" Description="{Binding Message}" Type="{Binding Type}"/>-->
|
2025-09-08 19:49:09 +08:00
|
|
|
<Grid Margin="5">
|
2025-08-12 23:08:54 +08:00
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
<!-- Icon Section (CORRECTED) -->
|
2025-09-08 19:49:09 +08:00
|
|
|
<controls:IconElement
|
2026-01-02 17:30:30 +08:00
|
|
|
Cursor=""
|
2025-08-12 23:08:54 +08:00
|
|
|
Grid.Column="0"
|
|
|
|
|
Height="20"
|
|
|
|
|
Margin="0,0,16,0"
|
2025-12-23 21:35:54 +08:00
|
|
|
VerticalAlignment="Top"
|
2026-01-02 17:30:30 +08:00
|
|
|
Width="20"
|
|
|
|
|
x:Name="IconElement">
|
2025-09-08 19:49:09 +08:00
|
|
|
<controls:IconElement.Style>
|
|
|
|
|
<Style BasedOn="{StaticResource IconElementStyle}" TargetType="controls:IconElement">
|
2025-08-12 23:08:54 +08:00
|
|
|
<Style.Triggers>
|
|
|
|
|
<DataTrigger Binding="{Binding Type}" Value="Success">
|
2025-09-08 19:49:09 +08:00
|
|
|
<Setter Property="Symbol" Value="CheckCircle" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource SuccessBrush}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
</DataTrigger>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
2025-08-12 23:08:54 +08:00
|
|
|
<DataTrigger Binding="{Binding Type}" Value="Info">
|
2025-09-08 19:49:09 +08:00
|
|
|
<Setter Property="Symbol" Value="Info" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource InfoBrush}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
</DataTrigger>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
2025-08-12 23:08:54 +08:00
|
|
|
<DataTrigger Binding="{Binding Type}" Value="Warning">
|
2025-09-08 19:49:09 +08:00
|
|
|
<Setter Property="Symbol" Value="Warning" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource WarningBrush}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
</DataTrigger>
|
2025-09-08 19:49:09 +08:00
|
|
|
|
2025-08-12 23:08:54 +08:00
|
|
|
<DataTrigger Binding="{Binding Type}" Value="Error">
|
2025-09-08 19:49:09 +08:00
|
|
|
<Setter Property="Symbol" Value="Error" />
|
|
|
|
|
<Setter Property="Foreground" Value="{DynamicResource ErrorBrush}" />
|
2025-08-12 23:08:54 +08:00
|
|
|
</DataTrigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
2025-09-08 19:49:09 +08:00
|
|
|
</controls:IconElement.Style>
|
|
|
|
|
</controls:IconElement>
|
2025-08-12 23:08:54 +08:00
|
|
|
<!-- Content Section -->
|
2025-12-23 21:35:54 +08:00
|
|
|
<StackPanel Grid.Column="1" d:DataContext="{d:DesignInstance Type=controls:NotificationModel}">
|
2025-08-12 23:08:54 +08:00
|
|
|
<TextBlock
|
|
|
|
|
FontSize="16"
|
|
|
|
|
FontWeight="Bold"
|
|
|
|
|
Foreground="{DynamicResource TextPrimaryBrush}"
|
2026-01-02 17:30:30 +08:00
|
|
|
Margin="0,0,0,4"
|
|
|
|
|
Name="TitleTextBlock"
|
2025-08-12 23:08:54 +08:00
|
|
|
Text="{Binding Title}" />
|
|
|
|
|
<TextBlock
|
|
|
|
|
FontSize="14"
|
|
|
|
|
Foreground="{DynamicResource TextPrimaryBrush}"
|
2026-01-02 17:30:30 +08:00
|
|
|
Name="MessageTextBlock"
|
2025-08-12 23:08:54 +08:00
|
|
|
Text="{Binding Message}"
|
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
<!-- Close Button -->
|
|
|
|
|
<Button
|
2026-01-02 17:30:30 +08:00
|
|
|
Click="CloseButton_Click"
|
|
|
|
|
Cursor="Hand"
|
2025-08-12 23:08:54 +08:00
|
|
|
Grid.Column="2"
|
|
|
|
|
Margin="8,-4,-4,-4"
|
2026-01-02 17:30:30 +08:00
|
|
|
Name="CloseButton"
|
|
|
|
|
VerticalAlignment="Top">
|
2025-08-12 23:08:54 +08:00
|
|
|
<Button.Template>
|
|
|
|
|
<ControlTemplate TargetType="Button">
|
2025-10-04 08:52:23 +08:00
|
|
|
<controls:IconElement Foreground="{DynamicResource TextSecondaryBrush}" Symbol="Close" />
|
2025-08-12 23:08:54 +08:00
|
|
|
</ControlTemplate>
|
|
|
|
|
</Button.Template>
|
|
|
|
|
</Button>
|
|
|
|
|
</Grid>
|
2025-09-04 22:39:00 +08:00
|
|
|
</Border>
|
2025-08-12 23:08:54 +08:00
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
|
</Window>
|