add ButtonGroup
replaced RadioButton with ButtonGroup
This commit is contained in:
1 parent
aee1d2eff4
commit
73a17ecc79
32 files changed
+452
-81
No files matched your search
@@ -0,0 +1,71 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.ButtonGroupDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Background="{DynamicResource RegionBrush}"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs">
|
||||
<hc:TransitioningContentControl>
|
||||
<WrapPanel Margin="16" VerticalAlignment="Center">
|
||||
<StackPanel Margin="16">
|
||||
<hc:ButtonGroup>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="0,32,0,0">
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="0,32,0,0" Style="{StaticResource ButtonGroupSolid}">
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="0,32,0,0">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||
</hc:ButtonGroup>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="16" Orientation="Horizontal">
|
||||
<hc:ButtonGroup Orientation="Vertical">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="32,0,0,0" Orientation="Vertical">
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="32,0,0,0" Style="{StaticResource ButtonGroupSolid}" Orientation="Vertical">
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
</hc:ButtonGroup>
|
||||
<hc:ButtonGroup Margin="32,0,0,0" Orientation="Vertical">
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||
</hc:ButtonGroup>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class ButtonGroupDemoCtl
|
||||
{
|
||||
public ButtonGroupDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
|
||||
"Source", typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame)));
|
||||
|
||||
public BitmapFrame Source
|
||||
{
|
||||
get => (BitmapFrame) GetValue(SourceProperty);
|
||||
set => SetValue(SourceProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
|
||||
"DisplayName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
|
||||
|
||||
public string DisplayName
|
||||
{
|
||||
get => (string) GetValue(UserNameProperty);
|
||||
set => SetValue(UserNameProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty LinkProperty = DependencyProperty.Register(
|
||||
"Link", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
|
||||
|
||||
public string Link
|
||||
{
|
||||
get => (string) GetValue(LinkProperty);
|
||||
set => SetValue(LinkProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user