Files
Shrlalgo.RvKits/AntdWpfDemo/Views/SelectView.xaml
2025-07-31 20:12:24 +08:00

76 lines
4.3 KiB
XML

<UserControl
d:DataContext="{d:DesignInstance Type=viewmodels:SelectViewModel}"
d:DesignHeight="600"
d:DesignWidth="930"
mc:Ignorable="d"
x:Class="AntDesignWPFDemo.Views.SelectView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:antd="https://github.com/ShrlAlgo/AntDesignWPF"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="clr-namespace:AntDesignWPFDemo.ViewModels"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ScrollViewer>
<Grid Margin="16,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel>
<Label Content="Select" Style="{StaticResource Ant.H1}" />
<TextBlock Style="{StaticResource Ant.P}" Text="Select component to select value from options." />
<Label Content="When To Use" Style="{StaticResource Ant.H2}" />
<TextBlock Style="{StaticResource Ant.P}" Text="A dropdown menu for displaying choices - an elegant alternative to the native select element.&#x0a;Utilizing Radio is recommended when there are fewer total options (less than 5)." />
<Label Content="Examples" Style="{StaticResource Ant.H2}" />
</StackPanel>
<Grid Grid.Row="1">
<Grid.Resources>
<Style BasedOn="{StaticResource Ant.ComboBox}" TargetType="ComboBox">
<Setter Property="Margin" Value="0,0,8,10" />
</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>
<ComboBox antd:Input.Placeholder="Basic usage">
<ComboBoxItem>Jack</ComboBoxItem>
<ComboBoxItem>Luck</ComboBoxItem>
<ComboBoxItem IsEnabled="False">Disabled</ComboBoxItem>
<ComboBoxItem>yiminghe</ComboBoxItem>
</ComboBox>
<ComboBox IsEnabled="False" antd:Input.Placeholder="Basic usage">
<ComboBoxItem>Jack</ComboBoxItem>
<ComboBoxItem IsSelected="True">Luck</ComboBoxItem>
<ComboBoxItem IsEnabled="False">Disabled</ComboBoxItem>
<ComboBoxItem>yiminghe</ComboBoxItem>
</ComboBox>
</StackPanel>
</antd:CodeBox.Content>
<antd:CodeBox.Code>
&lt;ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Theme.xaml" /&gt;\n
&lt;ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/AntIcons.xaml" /&gt;\n\n
xmlns:antd="https://github.com/ShrlAlgo/AntDesignWPF"\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.Attached="[Event Closing] = [Action Closing($source, $eventArgs)]"&gt;Prevent Default&lt;/antd:Tag&gt;\n
&lt;/WrapPanel&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
</StackPanel>
<StackPanel Grid.Column="1" Margin="8,0" />
</Grid>
</Grid>
</ScrollViewer>
</UserControl>