mirror of
https://gitee.com/chinware/atomui.git
synced 2024-12-02 11:57:42 +08:00
33 lines
903 B
C#
33 lines
903 B
C#
using Avalonia.Controls;
|
|
|
|
namespace AtomUI.Demo.Desktop.ShowCase;
|
|
|
|
public partial class RadioButtonShowCase : UserControl
|
|
{
|
|
protected List<string> CheckRadios { get; set; }
|
|
|
|
public RadioButtonShowCase()
|
|
{
|
|
CheckRadios = new List<string>()
|
|
{
|
|
"ToggleDisabledRadioUnChecked",
|
|
"ToggleDisabledRadioChecked"
|
|
};
|
|
InitializeComponent();
|
|
}
|
|
|
|
public static void ToggleDisabledStatus(object arg)
|
|
{
|
|
var btn = (arg as Button)!;
|
|
var stackPanel = btn.Parent as StackPanel;
|
|
var radioBtn1 = stackPanel?.FindControl<RadioButton>("ToggleDisabledRadioUnChecked");
|
|
var radioBtn2 = stackPanel?.FindControl<RadioButton>("ToggleDisabledRadioChecked");
|
|
if (radioBtn1 != null) {
|
|
radioBtn1.IsEnabled = !radioBtn1.IsEnabled;
|
|
}
|
|
|
|
if (radioBtn2 != null) {
|
|
radioBtn2.IsEnabled = !radioBtn2.IsEnabled;
|
|
}
|
|
}
|
|
} |