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,197 @@
<UserControl x:Class="AntdWpfDemo.Views.InputView"
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="Input" />
<TextBlock Style="{StaticResource Ant.P}" Text="A basic widget for getting the user input is a text field. Keyboard and mouse can be used for providing or changing data." />
<Label Style="{StaticResource Ant.H2}" Content="When To Use" />
<TextBlock Style="{StaticResource Ant.P}" Text="A user input in a form field is needed.&#x0a;A search input is required." />
<Label Style="{StaticResource Ant.H2}" Content="Examples" />
</StackPanel>
<Grid Grid.Row="1">
<Grid.Resources>
<Style BasedOn="{StaticResource Ant.TextBox}" TargetType="TextBox">
<Setter Property="Margin" Value="0 16 16 0" />
</Style>
<Style BasedOn="{StaticResource Ant.PasswordBox}" TargetType="PasswordBox">
<Setter Property="Margin" Value="0 16 16 0" />
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Margin="8 0">
<antd:CodeBox Title="Basic usage">
<antd:CodeBox.Description>
Basic usage example.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<TextBox antd:Input.Placeholder="Basic usage" />
<PasswordBox antd:Input.Placeholder="Basic usage" antd:Input.Eyeable="True" Password="666" />
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/AntIcons.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;WrapPanel&gt;\n
\t&lt;antd:Tag&gt;Tag 1&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag&gt;Link&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag Closable="True"&gt;Tag 2&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag Closable="True" cal:Message.Attach="[Event Closing] = [Action Closing($source, $eventArgs)]"&gt;Prevent Default&lt;/antd:Tag&gt;\n
&lt;/WrapPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="Pre / Post tab">
<antd:CodeBox.Description>
Using pre &amp; post tabs example.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<antd:Border Grid.Column="0"
UseLayoutRounding="True"
CornerRadius="4 0 0 4"
BorderThickness="1 1 0 1"
BorderBrush="{DynamicResource InputBorderBrush}" Padding="11 0">
<TextBlock Text="http://" VerticalAlignment="Center" />
</antd:Border>
<TextBox Grid.Column="1" Text="mysite" Margin="0" antd:Control.CornerRadius="0" />
<antd:Border Grid.Column="2"
UseLayoutRounding="True"
CornerRadius="0 4 4 0"
BorderThickness="0 1 1 1"
BorderBrush="{DynamicResource InputBorderBrush}" Padding="11 0">
<TextBlock Text=".com" VerticalAlignment="Center" />
</antd:Border>
</Grid>
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/AntIcons.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;WrapPanel&gt;\n
\t&lt;antd:Tag&gt;Tag 1&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag&gt;Link&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag Closable="True"&gt;Tag 2&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag Closable="True" cal:Message.Attach="[Event Closing] = [Action Closing($source, $eventArgs)]"&gt;Prevent Default&lt;/antd:Tag&gt;\n
&lt;/WrapPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="Search box">
<antd:CodeBox.Description>
Example of creating a search box by grouping a standard input with a search button.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<TextBox antd:Input.Placeholder="input search text" antd:Input.Clearable="True">
<antd:Input.Suffix>
<antd:Icon Type="search" />
</antd:Input.Suffix>
</TextBox>
<TextBox antd:Input.Placeholder="input search text" Padding="12 0 0 0">
<antd:Input.Suffix>
<antd:Button Margin="8 -1 -2 -1" Type="Primary" Content="Search" antd:Control.CornerRadius="0 4 4 0" />
</antd:Input.Suffix>
</TextBox>
<TextBox antd:Input.Placeholder="input search text" antd:Control.Size="Large" Padding="12 0 0 0">
<antd:Input.Suffix>
<antd:Button Type="Primary" Size="Large" Margin="8 -1 -2 -1" Content="Search" antd:Control.CornerRadius="0 4 4 0" />
</antd:Input.Suffix>
</TextBox>
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/AntIcons.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;WrapPanel&gt;\n
\t&lt;antd:Tag&gt;Tag 1&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag&gt;Link&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag Closable="True"&gt;Tag 2&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag Closable="True" cal:Message.Attach="[Event Closing] = [Action Closing($source, $eventArgs)]"&gt;Prevent Default&lt;/antd:Tag&gt;\n
&lt;/WrapPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="Prefix and Suffix">
<antd:CodeBox.Description>
Add prefix or suffix icons inside input.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<TextBox antd:Input.Placeholder="Enter your username">
<antd:Input.Prefix>
<antd:Icon Type="user" Foreground="#3F000000" />
</antd:Input.Prefix>
<antd:Input.Suffix>
<antd:Icon Type="close" Foreground="#3F000000" />
</antd:Input.Suffix>
</TextBox>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/AntIcons.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;TextBox antd:Input.Placeholder="Enter your username"&gt;\n
\t&lt;antd:Input.Prefix&gt;\n
\t\t&lt;antd:Icon Type="user" Foreground="#3F000000" /&gt;\n
\t&lt;/antd:Input.Prefix&gt;\n
\t&lt;antd:Input.Suffix&gt;\n
\t\t&lt;antd:Icon Type="close" Foreground="#3F000000" /&gt;\n
\t&lt;/antd:Input.Suffix&gt;\n
&lt;/TextBox&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
</StackPanel>
<StackPanel Grid.Column="1" Margin="8 0">
<antd:CodeBox Title="Three sizes of Input">
<antd:CodeBox.Description>
There are three sizes of an Input box: `Large` (40px)、`Default` (32px) and `Small` (24px).
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<TextBox antd:Input.Placeholder="large size" antd:Control.Size="Large" />
<TextBox antd:Input.Placeholder="default size" />
<TextBox antd:Input.Placeholder="small size" antd:Control.Size="Small" />
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/Theme.xaml" /&gt;\n
&lt;ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Themes/AntIcons.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntdWpf"\n\n
&lt;WrapPanel&gt;\n
\t&lt;antd:Tag&gt;Tag 1&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag&gt;Link&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag Closable="True"&gt;Tag 2&lt;/antd:Tag&gt;\n
\t&lt;antd:Tag Closable="True" cal:Message.Attach="[Event Closing] = [Action Closing($source, $eventArgs)]"&gt;Prevent Default&lt;/antd:Tag&gt;\n
&lt;/WrapPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
</StackPanel>
</Grid>
</Grid>
</ScrollViewer>
</UserControl>