Files
Shrlalgo.RvKits/AntdWpfDemo/Views/RadioButtonView.xaml

106 lines
6.2 KiB
Plaintext
Raw Normal View History

2025-07-11 09:20:23 +08:00
<UserControl x:Class="AntdWpfDemo.Views.RadioButtonView"
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="*" />
</Grid.RowDefinitions>
<StackPanel>
<Label Style="{StaticResource Ant.H1}" Content="Radio" />
<TextBlock Style="{StaticResource Ant.P}" Text="Radio." />
<Label Style="{StaticResource Ant.H2}" Content="When To Use" />
<TextBlock Style="{StaticResource Ant.P}"
TextWrapping="Wrap"
Text="Used to select a single state in multiple options.&#x0a;The difference between Select is that Radio is visible to user and can facilitate the comparison of choice, which makes there shouldn't be too many of them." />
<Label Style="{StaticResource Ant.H2}" Content="Examples" />
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Margin="8 0">
<antd:CodeBox Title="Basic">
<antd:CodeBox.Description>
The simplest use.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<RadioButton Content="Radio" />
</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/Styles/antd.xaml" /&gt;\n\n
&lt;RadioButton Content="Radio" /&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="Radio Group">
<antd:CodeBox.Description>
A group of radio components.
</antd:CodeBox.Description>
<!--<antd:CodeBox.Content>
<antd:RadioButtonGroup Orientation="Vertical">
<RadioButton Content="A" />
<RadioButton Content="B" GroupName="A" />
<RadioButton Content="C" GroupName="A" />
<RadioButton Content="D" />
</antd:RadioButtonGroup>
</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/Styles/antd.xaml" /&gt;\n\n
&lt;RadioButton Content="Radio" /&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
<antd:CodeBox Title="RadioGroup group - ItemsSource">
<antd:CodeBox.Description>
Render radios by configuring `ItemsSource`.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<antd:RadioButtonGroup ItemsSource="{Binding Items}" DisplayMemberPath="Label" Orientation="Vertical" />
</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/Styles/antd.xaml" /&gt;\n\n
&lt;RadioButton Content="Radio" /&gt;
</antd:CodeBox.Code>
</antd:CodeBox>
</StackPanel>
<StackPanel Grid.Column="1" Margin="8 0">
<antd:CodeBox Title="Disabled">
<antd:CodeBox.Description>
Radio unavailable.
</antd:CodeBox.Description>
<antd:CodeBox.Content>
<StackPanel>
<RadioButton Content="Radio" IsEnabled="{Binding IsEnabled}" Margin="0 0 0 8" />
<RadioButton Content="Radio" IsEnabled="{Binding IsEnabled}" IsChecked="True" />
2025-07-12 23:31:32 +08:00
<antd:AntButton x:Name="Toggle" Type="Primary" Content="Toggle disabled" Margin="0 20 0 0" />
2025-07-11 09:20:23 +08:00
</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/Styles/antd.xaml" /&gt;\n\n
&lt;StackPanel&gt;\n
\t&lt;RadioButton Content="Radio" IsEnabled="{Binding IsEnabled}" Margin="0 0 0 8" /&gt;\n
\t&lt;RadioButton Content="Radio" IsEnabled="{Binding IsEnabled}" IsChecked="True" /&gt;\n
\t&lt;antd:Button x:Name="Toggle" Type="Primary" Content="Toggle disabled" Margin="0 20 0 0" /&gt;\n
&lt;/StackPanel&gt;\n
</antd:CodeBox.Code>
</antd:CodeBox>
</StackPanel>
</Grid>
</Grid>
</ScrollViewer>
</UserControl>