コード例 #1
0
 public void SelectedItemChanged(object o)
 {
     //ActiveItem = obj;
     Console.WriteLine(o.ToString());
     if (o is GroupTreeItemViewModel)
     {
         GroupTreeItemViewModel g   = o as GroupTreeItemViewModel;
         GroupViewModel         gVM = new GroupViewModel(g);
         ActivateItem(gVM);
         //ActivateItem(o);
     }
     else if (o is CollectionPointTreeItemViewModel)
     {
         CollectionPointTreeItemViewModel c   = o as CollectionPointTreeItemViewModel;
         CollectionPointViewModel         gVM = new CollectionPointViewModel(c);
         ActivateItem(gVM);
         //ActivateItem(o);
     }
     else if (o is IpRangeTreeItemViewModel)
     {
         IpRangeTreeItemViewModel ip  = o as IpRangeTreeItemViewModel;
         IpRangeViewModel         gVM = new IpRangeViewModel(ip);
         ActivateItem(gVM);
         //ActivateItem(o);
     }
 }
コード例 #2
0
        public void AddNewGroup(object o)
        {
            GroupTreeItemViewModel groupVM = new GroupTreeItemViewModel(Parent, new Group {
                Name = "New Group"
            });

            Parent.Children.Add(groupVM);
        }
コード例 #3
0
        public CollectionPointTreeItemViewModel(GroupTreeItemViewModel parent, CollectionPoint dataModel)
        {
            Parent    = parent;
            DataModel = dataModel;

            Children = new BindableCollection <IpRangeTreeItemViewModel> {
                new IpRangeTreeItemViewModel(this, new IpRange {
                    Name = "New IP Range"
                }),
                new IpRangeTreeItemViewModel(this, new IpRange {
                    Name = "a1"
                }),
                new IpRangeTreeItemViewModel(this, new IpRange {
                    Name = "a1"
                }),
                new IpRangeTreeItemViewModel(this, new IpRange {
                    Name = "a1"
                })
            };
        }
コード例 #4
0
 public CollectionPointTreeItemViewModel(GroupTreeItemViewModel parent)
     : this(parent, new CollectionPoint())
 {
 }
コード例 #5
0
 public GroupViewModel(GroupTreeItemViewModel dataModel)
 {
     DataModel = dataModel;
 }