コード例 #1
0
        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();
        }
コード例 #2
0
        public DeredundafierViewModel(DeredundafierDTO data, DeredundafierViewModel parent)
        {
            Data   = data;
            Parent = parent;

            Children = new ObservableCollection <DeredundafierViewModel>();
        }
コード例 #3
0
 public PassiveViewModel(DeredundafierDTO data, DeredundafierViewModel parent)
     : base(data, parent)
 {
     foreach (DeredundafierDTO child in data.Children)
     {
         Children.Add(new PassiveViewModel(child, this));
     }
 }
コード例 #4
0
 public PotentialMatchViewModel(DeredundafierDTO data)
     : base(data, null)
 {
     foreach (SelectorDTO child in data.Children)
     {
         Children.Add(new SelectorViewModel(child, this));
     }
 }