private void childrens_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
this.NotifyOfPropertyChange(() => this.Count);
switch (e.Action)
{
case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
{
foreach (TreeViewItemViewModel item in e.NewItems)
{
item.parent = this;
}
}
break;
case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
{
foreach (TreeViewItemViewModel item in e.OldItems)
{
item.parent = null;
}
}
break;
}
}