功能更新
This commit is contained in:
107
Melskin/Controls/Notification/NotificationView.xaml
Normal file
107
Melskin/Controls/Notification/NotificationView.xaml
Normal file
@@ -0,0 +1,107 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user