public DeredundafierMockTree() { var parent = new DeredundafierDTO() { Name = "Test 1 - None Checked" }; parent.Children.Add(new SelectorDTO() { IsChecked = false }); parent.Children.Add(new SelectorDTO() { IsChecked = false }); ViewModels.Add(new PotentialMatchViewModel(parent)); (ViewModels.Last() as PotentialMatchViewModel).ReevaluateColor(); parent = new DeredundafierDTO() { Name = "Test 2 - Mixed Checks" }; var child = new SelectorDTO() { Name = "SubTest 1", IsChecked = true }; child.Children.Add(new DeredundafierDTO()); parent.Children.Add(child); child = new SelectorDTO() { Name = "SubTest 2", IsChecked = false }; child.Children.Add(new DeredundafierDTO()); parent.Children.Add(child); ViewModels.Add(new PotentialMatchViewModel(parent) { IsExpanded = true }); (ViewModels.Last() as PotentialMatchViewModel).ReevaluateColor(); parent = new DeredundafierDTO() { Name = "Test 3 - All Checked" }; parent.Children.Add(new SelectorDTO() { IsChecked = true }); parent.Children.Add(new SelectorDTO() { IsChecked = true }); ViewModels.Add(new PotentialMatchViewModel(parent)); (ViewModels.Last() as PotentialMatchViewModel).ReevaluateColor(); }
public DeredundafierViewModel(DeredundafierDTO data, DeredundafierViewModel parent) { Data = data; Parent = parent; Children = new ObservableCollection <DeredundafierViewModel>(); }
public PassiveViewModel(DeredundafierDTO data, DeredundafierViewModel parent) : base(data, parent) { foreach (DeredundafierDTO child in data.Children) { Children.Add(new PassiveViewModel(child, this)); } }
public PotentialMatchViewModel(DeredundafierDTO data) : base(data, null) { foreach (SelectorDTO child in data.Children) { Children.Add(new SelectorViewModel(child, this)); } }