public MainWindow() { InitializeComponent(); ChecksModel model = new ChecksModel("Main"); ChecksModel m1 = new ChecksModel("Branch"); m1.AddChild(new ChecksModel("1st")); m1.AddChild(new ChecksModel("2nd")); model.AddChild(m1); model.AddChild(new ChecksModel("3rd")); model.AddChild(new ChecksModel("4th")); DataContext = model; }
public void AddChild(ChecksModel child) { Children.Add(child); }