2025-02-10 20:53:40 +08:00
|
|
|
<UserControl
|
2025-07-11 09:20:23 +08:00
|
|
|
Focusable="False"
|
|
|
|
|
FontSize="16"
|
|
|
|
|
MaxWidth="500"
|
|
|
|
|
MinWidth="50"
|
|
|
|
|
Opacity="1"
|
|
|
|
|
d:DesignHeight="35"
|
|
|
|
|
d:DesignWidth="120"
|
|
|
|
|
mc:Ignorable="d"
|
2025-02-10 20:53:40 +08:00
|
|
|
x:Class="WPFluent.Controls.ToastControl"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2025-07-11 09:20:23 +08:00
|
|
|
xmlns:controls="clr-namespace:WPFluent.Controls"
|
2025-02-10 20:53:40 +08:00
|
|
|
xmlns:conv="clr-namespace:WPFluent.Converters"
|
2025-07-11 09:20:23 +08:00
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
2025-02-10 20:53:40 +08:00
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
2025-07-11 09:20:23 +08:00
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
2025-02-10 20:53:40 +08:00
|
|
|
<UserControl.Resources>
|
|
|
|
|
<FontFamily x:Key="SymbolThemeFontFamily">pack://application:,,,/WPFluent;component/Resources/Fonts/Segoe Fluent Icons.ttf#Segoe Fluent Icons</FontFamily>
|
|
|
|
|
</UserControl.Resources>
|
|
|
|
|
<Border
|
2025-07-11 09:20:23 +08:00
|
|
|
Background="{DynamicResource ApplicationBackgroundColorBrush}"
|
2025-02-10 20:53:40 +08:00
|
|
|
BorderBrush="{DynamicResource ControlElevationBorderBrush}"
|
|
|
|
|
BorderThickness="{Binding BorderThickness}"
|
2025-07-11 09:20:23 +08:00
|
|
|
CornerRadius="{Binding CornerRadius}"
|
|
|
|
|
Padding="8">
|
2025-02-10 20:53:40 +08:00
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
|
|
<ColumnDefinition Width="*" />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<TextBlock
|
|
|
|
|
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
|
|
|
|
FontSize="{Binding IconSize}"
|
|
|
|
|
Foreground="{Binding ToastIcon, Converter={x:Static conv:ToastIconForegroundConverter.New}}"
|
2025-07-11 09:20:23 +08:00
|
|
|
Grid.Column="0"
|
|
|
|
|
Height="16"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
Margin="0,0,6,0"
|
2025-02-10 20:53:40 +08:00
|
|
|
Text="{Binding ToastIcon, Converter={x:Static conv:ToastIconConverter.New}}"
|
2025-07-11 09:20:23 +08:00
|
|
|
VerticalAlignment="Center"
|
|
|
|
|
Visibility="{Binding ToastIcon, Converter={x:Static conv:ToastIconVisibilityConverter.New}}"
|
|
|
|
|
Width="16" />
|
2025-02-10 20:53:40 +08:00
|
|
|
<TextBlock
|
|
|
|
|
FontFamily="{DynamicResource TextThemeFontFamily}"
|
|
|
|
|
FontSize="{Binding FontSize}"
|
|
|
|
|
FontStretch="{Binding FontStretch}"
|
|
|
|
|
FontStyle="{Binding FontStyle}"
|
|
|
|
|
FontWeight="{Binding FontWeight}"
|
2025-07-11 09:20:23 +08:00
|
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
HorizontalAlignment="{Binding HorizontalContentAlignment}"
|
|
|
|
|
Text="{Binding Message}"
|
|
|
|
|
VerticalAlignment="{Binding VerticalContentAlignment}" />
|
2025-02-10 20:53:40 +08:00
|
|
|
</Grid>
|
2025-07-11 09:20:23 +08:00
|
|
|
<!--<controls:InfoBar
|
|
|
|
|
Grid.Column="1"
|
|
|
|
|
Severity="Attention"
|
|
|
|
|
HorizontalAlignment="{Binding HorizontalContentAlignment}"
|
|
|
|
|
VerticalAlignment="{Binding VerticalContentAlignment}"
|
|
|
|
|
FontFamily="{DynamicResource TextThemeFontFamily}"
|
|
|
|
|
FontSize="{Binding FontSize}"
|
|
|
|
|
FontStretch="{Binding FontStretch}"
|
|
|
|
|
FontStyle="{Binding FontStyle}"
|
|
|
|
|
FontWeight="{Binding FontWeight}"
|
|
|
|
|
IsOpen="{Binding}"
|
|
|
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
|
|
|
Message="{Binding Message}" />-->
|
2025-02-10 20:53:40 +08:00
|
|
|
</Border>
|
2025-07-11 09:20:23 +08:00
|
|
|
</UserControl>
|