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); } }
public void AddNewGroup(object o) { GroupTreeItemViewModel groupVM = new GroupTreeItemViewModel(Parent, new Group { Name = "New Group" }); Parent.Children.Add(groupVM); }
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" }) }; }
public CollectionPointTreeItemViewModel(GroupTreeItemViewModel parent) : this(parent, new CollectionPoint()) { }
public GroupViewModel(GroupTreeItemViewModel dataModel) { DataModel = dataModel; }