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