功能更新
This commit is contained in:
69
Melskin/Controls/Toast/ToastControl.xaml
Normal file
69
Melskin/Controls/Toast/ToastControl.xaml
Normal file
@@ -0,0 +1,69 @@
|
||||
<UserControl
|
||||
HorizontalAlignment="Center"
|
||||
MinHeight="50"
|
||||
Width="320"
|
||||
mc:Ignorable="d"
|
||||
x:Class="Melskin.Controls.ToastControl"
|
||||
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">
|
||||
<Border
|
||||
Background="{DynamicResource BackgroundFloatingBrush}"
|
||||
BorderBrush="{DynamicResource BorderNormalBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4"
|
||||
x:Name="RootBorder">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect
|
||||
BlurRadius="8"
|
||||
Direction="270"
|
||||
Opacity="0.15"
|
||||
ShadowDepth="1" />
|
||||
</Border.Effect>
|
||||
<StackPanel Margin="15,12" Orientation="Horizontal">
|
||||
<controls:IconElement
|
||||
Height="20"
|
||||
Margin="0,0,14,0"
|
||||
Width="20"
|
||||
x:Name="Icon">
|
||||
<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>
|
||||
<TextBlock
|
||||
Foreground="{DynamicResource TextPrimaryBrush}"
|
||||
Text="This is a toast message."
|
||||
TextWrapping="Wrap"
|
||||
VerticalAlignment="Center"
|
||||
x:Name="MessageTextBlock" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</UserControl>
|
||||
Reference in New Issue
Block a user