This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -0,0 +1,200 @@
<UserControl x:Class="AntdWpfDemo.Views.AlertView"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"
mc:Ignorable="d"
d:DesignHeight="600"
d:DesignWidth="930">
<ScrollViewer>
<Grid Margin="16 0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel>
<Label Style="{StaticResource Ant.H1}" Content="Alert" />
<TextBlock Style="{StaticResource Ant.P}" Text="Alert component for feedback." />
<Label Style="{StaticResource Ant.H2}" Content="When To Use" />
<TextBlock Style="{StaticResource Ant.P}" Text="When you need to show alert messages to users.&#x0a;When you need a persistent static container which is closable by user actions." />
<Label Style="{StaticResource Ant.H2}" Content="Examples" />
</StackPanel>
<Grid Grid.Row="1">
<Grid.Resources>
<Style TargetType="antd:Alert">
<Setter Property="Margin" Value="0 0 0 15" />
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Margin="8 0">
<antd:CodeBox Title="Basic" >
<antd:CodeBox.Description>
The simplest usage for short messages.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<antd:Alert Type="Success" Message="Success Text" />
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;antd:Alert Type="Success" Message="Success Text" /&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="Closable">
<antd:CodeBox.Description>
To show close button.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<antd:Alert Type="Warning" Closable="True" VerticalContentAlignment="Top">
Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text
</antd:Alert>
<antd:Alert Type="Error" Message="Error Text" Closable="True">
<antd:Alert.Description>
Error Description Error Description Error Description Error Description Error Description Error Description
</antd:Alert.Description>
</antd:Alert>
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;StackPanel&gt;\n
\t&lt;antd:Alert Type="Warning" Closable="True" VerticalContentAlignment="Top"&gt;\n
\t\tWarning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text\n
\t&lt;/antd:Alert&gt;\n
\t&lt;antd:Alert Type="Error" Message="Error Text" Closable="True"&gt;\n
\t\t&lt;antd:Alert.Description&gt;\n
\t\tError Description Error Description Error Description Error Description Error Description Error Description\n
\t\t&lt;/antd:Alert.Description&gt;\n
\t&lt;/antd:Alert&gt;\n
&lt;/StackPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="Icon">
<antd:CodeBox.Description>
Decent icon make information more clear and more friendly.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<antd:Alert Type="Success" Message="Success Tips" ShowIcon="True" />
<antd:Alert Message="Informational Notes" ShowIcon="True" />
<antd:Alert Type="Warning" Message="Warning" ShowIcon="True" />
<antd:Alert Type="Error" Message="Error" ShowIcon="True" />
<antd:Alert Type="Success" Message="Success Tips" Description="Detailed description and advices about successful copywriting." ShowIcon="True" />
<antd:Alert Message="Informational Notes" Description="Additional description and informations about copywriting." ShowIcon="True" />
<antd:Alert Type="Warning" Message="Warning" Description="This is a warning notice about copywriting." ShowIcon="True" />
<antd:Alert Type="Error" Message="Error" Description="This is an error message about copywriting." ShowIcon="True" />
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;StackPanel&gt;\n
\t&lt;antd:Alert Type="Success" Message="Success Tips" ShowIcon="True" /&gt;\n
\t&lt;antd:Alert Message="Informational Notes" ShowIcon="True" /&gt;\n
\t&lt;antd:Alert Type="Warning" Message="Warning" ShowIcon="True" /&gt;\n
\t&lt;antd:Alert Type="Error" Message="Error" ShowIcon="True" /&gt;\n
\t&lt;antd:Alert Type="Success" Message="Success Tips" Description="Detailed description and advices about successful copywriting." ShowIcon="True" /&gt;\n
\t&lt;antd:Alert Message="Informational Notes" Description="Additional description and informations about copywriting." ShowIcon="True" /&gt;\n
\t&lt;antd:Alert Type="Warning" Message="Warning" Description="This is a warning notice about copywriting." ShowIcon="True" /&gt;\n
\t&lt;antd:Alert Type="Error" Message="Error" Description="This is an error message about copywriting." ShowIcon="True" /&gt;\n
&lt;/StackPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
</StackPanel>
<StackPanel Grid.Column="1" Margin="8 0">
<antd:CodeBox Title="More types">
<antd:CodeBox.Description>
There are 4 types of Alert: `Success`, `Info`, `Warning`, `Error`.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<antd:Alert Type="Success" Message="Success Text" />
<antd:Alert Message="Info Text" />
<antd:Alert Type="Warning" Message="Warning Text" />
<antd:Alert Type="Error" Message="Error Text" />
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;StackPanel&gt;\n
\t&lt;antd:Alert Type="Success" Message="Success Text" /&gt;\n
\t&lt;antd:Alert Message="Info Text" /&gt;\n
\t&lt;antd:Alert Type="Warning" Message="Warning Text" /&gt;\n
\t&lt;antd:Alert Type="Error" Message="Error Text" /&gt;\n
&lt;/StackPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="Description">
<antd:CodeBox.Description>
Additional description for alert message.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<antd:Alert Type="Success" Message="Success Text" Description="Success Description Success Description Success Description" />
<antd:Alert Message="Info Text" Description="Info Description Info Description Info Description Info Description" />
<antd:Alert Type="Warning" Message="Warning Text" Description="Warning Description Warning Description Warning Description Warning Description" />
<antd:Alert Type="Error" Message="Error Text" Description="Error Description Error Description Error Description Error Description" />
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;StackPanel&gt;\n
\t&lt;antd:Alert Type="Success" Message="Success Text" Margin="0 0 0 16" /&gt;\n
\t&lt;antd:Alert Message="Info Text" Margin="0 0 0 16" /&gt;\n
\t&lt;antd:Alert Type="Warning" Message="Warning Text" Margin="0 0 0 16" /&gt;\n
\t&lt;antd:Alert Type="Error" Message="Error Text" /&gt;\n
&lt;/StackPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="Customized Close Text">
<antd:CodeBox.Description>
Replace the default icon with customized text.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<antd:Alert Message="Info Text" CloseText="Close Now" />
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;StackPanel&gt;\n
\t&lt;antd:Alert Message="Info Text" CloseText="Close Now" /&gt;\n
&lt;/StackPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="Smoothly Unmount">
<antd:CodeBox.Description>
Smoothly and unaffectedly unmount Alert.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<antd:Alert Message="Alert Message Text" Closable="True" />
<TextBlock Text="placeholder text here" />
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;StackPanel&gt;\n
\t&lt;antd:Alert Message="Alert Message Text" Closable="True" /&gt;\n
\t&lt;TextBlock Text="placeholder text here" /&gt;\n
&lt;/StackPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
</StackPanel>
</Grid>
</Grid>
</ScrollViewer>
</UserControl>