private void ActiveViews_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) { if (stopcount > 0) { stopcount--; foreach (var t in e.NewItems) { DocumentWindowIns.AddUserControl(t, false); } } else { foreach (var t in e.NewItems) { DocumentWindowIns.AddUserControl(t, true); } } //DocumentWindowIns.RemovePanFromParent(e.NewItems[0]); } else if (e.Action == NotifyCollectionChangedAction.Remove) { foreach (var t in e.OldItems) { DocumentWindowIns.RemovePanFromParent(t); } } }
void Region_OnViewActivated(object sender, ActiveViewEventArgs e) { //throw new System.NotImplementedException(); DocumentWindowIns.AddUserControl(e.View, true); }