using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace Kingo.Plugin.NYYP.Common { public class KeyValueData { public string NodeID { get; set; } public string NodeName { get; set; } } public class TreeData : INotifyPropertyChanged { #region 字段 private string id; private string name; private Visibility visibility = Visibility.Collapsed; private List items; #endregion #region 属性 /// /// 获取或设置数据显示的ID /// public string ID { get { return id; } set { id = value; this.OnPropertyChanged("ID"); } } public string Name { get { return name; } set { name = value; } } /// /// 获取或设置数据子集 /// public List Items { get { return items; } set { items = value; this.OnPropertyChanged("Items"); } } /// /// Item上的自定义checkbox数据绑定 /// public Visibility Visibility { get { return visibility; } set { visibility = value; this.OnPropertyChanged("Visibility"); } } #endregion public TreeData() { } public TreeData(string name, string id, List items) { this.Name = name; this.Items = items; this.ID = id; } public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string prop) { if (this.PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(prop)); } } public class TreeModel : INotifyPropertyChanged { private string name = string.Empty; public List Items { get; set; } /// /// 当前选中项的名称,用于comboBox显示 /// public string Name { get { return name; } set { name = value; this.OnPropertyChanged("Name"); } } public TreeModel() { } public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string prop) { if (this.PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(prop)); } } }