100 lines
6.4 KiB
XML
100 lines
6.4 KiB
XML
<UserControl x:Class="AntDesignWPFDemo.Views.RadioButtonView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
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"
|
|
mc:Ignorable="d"
|
|
d:DataContext="{d:DesignInstance Type=viewmodels:RadioButtonViewModel}"
|
|
d:DesignHeight="600"
|
|
d:DesignWidth="930">
|
|
|
|
<ScrollViewer>
|
|
<Grid Margin="16,0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<StackPanel>
|
|
<Label Content="Radio" Style="{StaticResource Ant.H1}" />
|
|
<TextBlock Style="{StaticResource Ant.P}" Text="Radio." />
|
|
|
|
<Label Content="When To Use" Style="{StaticResource Ant.H2}" />
|
|
<TextBlock Style="{StaticResource Ant.P}"
|
|
Text="Used to select a single state in multiple options.
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."
|
|
TextWrapping="Wrap" />
|
|
|
|
<Label Content="Examples" Style="{StaticResource Ant.H2}" />
|
|
</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><ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Theme.xaml" />\n
|
|
<ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Styles/antd.xaml" />\n\n
|
|
<RadioButton Content="Radio" /></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><ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Theme.xaml" />\n
|
|
<ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Styles/antd.xaml" />\n\n
|
|
<RadioButton Content="Radio" /></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 DisplayMemberPath="Label"
|
|
ItemsSource="{Binding Items}"
|
|
Orientation="Vertical" />
|
|
</antd:CodeBox.Content>
|
|
<antd:CodeBox.Code><ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Theme.xaml" />\n
|
|
<ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Styles/antd.xaml" />\n\n
|
|
<RadioButton Content="Radio" /></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 Margin="0,0,0,8"
|
|
Content="Radio"
|
|
IsEnabled="{Binding IsEnabled}" />
|
|
<RadioButton Content="Radio"
|
|
IsChecked="True"
|
|
IsEnabled="{Binding IsEnabled}" />
|
|
<antd:AntButton x:Name="Toggle"
|
|
Margin="0,20,0,0"
|
|
Content="Toggle disabled"
|
|
Variant="Solid" />
|
|
</StackPanel>
|
|
</antd:CodeBox.Content>
|
|
<antd:CodeBox.Code><ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Theme.xaml" />\n
|
|
<ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Styles/antd.xaml" />\n\n
|
|
<StackPanel>\n
|
|
\t<RadioButton Content="Radio" IsEnabled="{Binding IsEnabled}" Margin="0 0 0 8" />\n
|
|
\t<RadioButton Content="Radio" IsEnabled="{Binding IsEnabled}" IsChecked="True" />\n
|
|
\t<antd:Button x:Name="Toggle" Type="Primary" Content="Toggle disabled" Margin="0 20 0 0" />\n
|
|
</StackPanel>\n</antd:CodeBox.Code>
|
|
</antd:CodeBox>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</ScrollViewer>
|
|
</UserControl> |