From 47357b88db0bb5fc6bffe7932909cbdbdaff1ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8-=E6=98=93-=E6=9D=A8?= <64038497@qq.com> Date: Sat, 2 Jan 2021 14:45:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0CanSelectRootNode=20=E4=B8=8E?= =?UTF-8?q?=20CheckBoxes=20=E4=BA=92=E6=96=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIComboTreeView.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/SunnyUI/Controls/UIComboTreeView.cs b/SunnyUI/Controls/UIComboTreeView.cs index 89e7637a..9b14830d 100644 --- a/SunnyUI/Controls/UIComboTreeView.cs +++ b/SunnyUI/Controls/UIComboTreeView.cs @@ -46,15 +46,25 @@ namespace Sunny.UI [Description("显示节点集合"), Category("SunnyUI")] public TreeNodeCollection Nodes => item.TreeView.Nodes; - [DefaultValue(false), Description("是否显示单选框"), Category("SunnyUI")] + [DefaultValue(false), Description("是否显示单选框,该属性与CanSelectRootNode互斥"), Category("SunnyUI")] public bool CheckBoxes { get => item.CheckBoxes; - set => item.CheckBoxes = value; + set { item.CheckBoxes = value; + if (value) + CanSelectRootNode = false; + } } - [DefaultValue(false), Description("单选时是否可选择父节点"), Category("SunnyUI")] - public bool CanSelectRootNode { get; set; } + [DefaultValue(false), Description("单选时是否可选择父节点,该属性与CheckBoxes互斥"), Category("SunnyUI")] + public bool CanSelectRootNode { + get =>item.CanSelectRootNode; + set { + item.CanSelectRootNode = value; + if (value) + CheckBoxes = false; + } + } [DefaultValue(false), Description("是否显示连线"), Category("SunnyUI")] public bool ShowLines