예제 #1
0
        protected void SetActiveView(IEnumerable <VisibleViewModelBase> views, VisibleViewModelBase wm)
        {
            ICollectionView collectionView = CollectionViewSource.GetDefaultView(views);

            if (collectionView != null && collectionView.Contains(wm))
            {
                collectionView.MoveCurrentTo(wm);
            }
        }
예제 #2
0
        public void PublishViewModel(TModel model)
        {
            VisibleViewModelBase wm = InternalCreateNewViewModel(model);

            if (wm != null)
            {
                OpenViewModels.Add(wm as EntityViewModelBase <TModel>);
            }
            wm.PublishEvent(EventTopicNames.ViewAdded);
        }
예제 #3
0
        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);
        }