Files
Shrlalgo.RvKits/Melskin/Controls/Notification/NotificationView.xaml
2026-02-17 22:17:13 +08:00

107 lines
4.8 KiB
XML

<Window
AllowsTransparency="True"
Background="Transparent"
Height="Auto"
ShowInTaskbar="False"
SizeToContent="Height"
Title="NotificationWindow"
Topmost="True"
Width="384"
WindowStyle="None"
mc:Ignorable="d"
x:Class="Melskin.Controls.NotificationView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:Melskin.Controls"
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">
<Grid>
<Border
Background="{DynamicResource BackgroundFloatingBrush}"
BorderThickness="1"
CornerRadius="4"
Margin="8"
x:Name="RootBorder">
<!--<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}"/>-->
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Icon Section (CORRECTED) -->
<controls:IconElement
Cursor=""
Grid.Column="0"
Height="20"
Margin="0,0,16,0"
VerticalAlignment="Top"
Width="20"
x:Name="IconElement">
<controls:IconElement.Style>
<Style BasedOn="{StaticResource IconElementStyle}" TargetType="controls:IconElement">
<Style.Triggers>
<DataTrigger Binding="{Binding Type}" Value="Success">
<Setter Property="Symbol" Value="CheckCircle" />
<Setter Property="Foreground" Value="{DynamicResource SuccessBrush}" />
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="Info">
<Setter Property="Symbol" Value="Info" />
<Setter Property="Foreground" Value="{DynamicResource InfoBrush}" />
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="Warning">
<Setter Property="Symbol" Value="Warning" />
<Setter Property="Foreground" Value="{DynamicResource WarningBrush}" />
</DataTrigger>
<DataTrigger Binding="{Binding Type}" Value="Error">
<Setter Property="Symbol" Value="Error" />
<Setter Property="Foreground" Value="{DynamicResource ErrorBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
</controls:IconElement.Style>
</controls:IconElement>
<!-- Content Section -->
<StackPanel Grid.Column="1" d:DataContext="{d:DesignInstance Type=controls:NotificationModel}">
<TextBlock
FontSize="16"
FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"
Margin="0,0,0,4"
Name="TitleTextBlock"
Text="{Binding Title}" />
<TextBlock
FontSize="14"
Foreground="{DynamicResource TextPrimaryBrush}"
Name="MessageTextBlock"
Text="{Binding Message}"
TextWrapping="Wrap" />
</StackPanel>
<!-- Close Button -->
<Button
Click="CloseButton_Click"
Cursor="Hand"
Grid.Column="2"
Margin="8,-4,-4,-4"
Name="CloseButton"
VerticalAlignment="Top">
<Button.Template>
<ControlTemplate TargetType="Button">
<controls:IconElement Foreground="{DynamicResource TextSecondaryBrush}" Symbol="Close" />
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</Border>
</Grid>
</Window>