From c1496c77a1743c70f14f7371e8a309207a5b4e06 Mon Sep 17 00:00:00 2001 From: "1678167865@qq.com" <1678167865@qq.com> Date: Mon, 8 Mar 2021 18:28:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9ERadioButton=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E3=80=81=E7=BB=84=E5=90=88=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9ECheckbox=E9=BB=98=E8=AE=A4=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SmartUI.Demo/Common/RelayCommand.cs | 27 ++++++ SmartUI.Demo/MainWindow.xaml | 80 +++++++++++++---- SmartUI.Demo/MainWindowModel.cs | 27 +++++- SmartUI.Demo/SmartUI.Demo.csproj | 1 + SmartUI/Assist/RadioButtonAssist.cs | 64 ++++++++++++++ SmartUI/Controls/CheckBoxGroup.cs | 81 ++++++++++++++++++ SmartUI/Images/u196.png | Bin 691 -> 0 bytes SmartUI/Images/u301.png | Bin 890 -> 0 bytes SmartUI/Images/u304.png | Bin 982 -> 0 bytes SmartUI/SmartUI.1.0.0.2.nupkg | Bin 0 -> 919893 bytes SmartUI/SmartUI.csproj | 15 ++-- SmartUI/SmartUI.nuspec | 7 +- SmartUI/Themes/CheckBoxStyle.xaml | 41 +++++++++ SmartUI/Themes/Default.xaml | 2 + SmartUI/Themes/LableStyle.xaml | 3 +- SmartUI/Themes/RadioButtonStyle.xaml | 123 +++++++++++++++++++++++++++ 16 files changed, 442 insertions(+), 29 deletions(-) create mode 100644 SmartUI.Demo/Common/RelayCommand.cs create mode 100644 SmartUI/Assist/RadioButtonAssist.cs create mode 100644 SmartUI/Controls/CheckBoxGroup.cs delete mode 100644 SmartUI/Images/u196.png delete mode 100644 SmartUI/Images/u301.png delete mode 100644 SmartUI/Images/u304.png create mode 100644 SmartUI/SmartUI.1.0.0.2.nupkg create mode 100644 SmartUI/Themes/CheckBoxStyle.xaml create mode 100644 SmartUI/Themes/RadioButtonStyle.xaml diff --git a/SmartUI.Demo/Common/RelayCommand.cs b/SmartUI.Demo/Common/RelayCommand.cs new file mode 100644 index 0000000..90d8cf4 --- /dev/null +++ b/SmartUI.Demo/Common/RelayCommand.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Input; + +namespace SmartUI.Demo.Common +{ + public class RelayCommand : ICommand + { + public event EventHandler CanExecuteChanged; + private readonly Action _execute; + + public RelayCommand(Action execute) + { + _execute = execute; + } + + public bool CanExecute(object parameter) => _execute != null; + + public void Execute(object parameter) + { + _execute(parameter); + } + } +} diff --git a/SmartUI.Demo/MainWindow.xaml b/SmartUI.Demo/MainWindow.xaml index 5b11f10..36eab34 100644 --- a/SmartUI.Demo/MainWindow.xaml +++ b/SmartUI.Demo/MainWindow.xaml @@ -56,24 +56,70 @@ - - - - - - - - - - - - - - - - - + +