protected void SetActiveView(IEnumerable <VisibleViewModelBase> views, VisibleViewModelBase wm) { ICollectionView collectionView = CollectionViewSource.GetDefaultView(views); if (collectionView != null && collectionView.Contains(wm)) { collectionView.MoveCurrentTo(wm); } }
public void PublishViewModel(TModel model) { VisibleViewModelBase wm = InternalCreateNewViewModel(model); if (wm != null) { OpenViewModels.Add(wm as EntityViewModelBase <TModel>); } wm.PublishEvent(EventTopicNames.ViewAdded); }
protected override void OnDuplicateItem(object obj) { var duplicate = ObjectCloner.EntityClone(SelectedItem.Model); duplicate.Id = 0; EntityIdFixer.FixEntityIdNumber(duplicate, x => 0); duplicate.Name = "_" + duplicate.Name; VisibleViewModelBase wm = InternalCreateNewViewModel(duplicate); if (wm != null) { OpenViewModels.Add(wm as EntityViewModelBase <TModel>); } wm.PublishEvent(EventTopicNames.ViewAdded); }