using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DataLoader.Model { public class TreeItem : INotifyPropertyChanged { private int id; private string name; private bool isChecked; private bool isExpanded; private ObservableCollection child; public event PropertyChangedEventHandler PropertyChanged; public TreeItem() { } public TreeItem(int id, string name, string fullName) { this.id = id; this.name = name; this.FullName = fullName; } public int ID { set { this.id = value; ChangProperty("ID"); } get { return this.id; } } public string Name { set { this.name = value; ChangProperty("Name"); } get { return this.name; } } public bool IsChecked { set { isChecked = value; ChangProperty("IsChecked"); } get { return this.isChecked; } } public bool IsExpanded { set { isExpanded = value; ChangProperty("IsExpanded"); } get { return isExpanded; } } public string FullName { set; get; } public ObservableCollection Child { set { child = value; ChangProperty("Child"); } get { return child; } } private void ChangProperty(string propName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propName)); } } } }