Example #1
0
        public void PublishViewModel(TModel model)
        {
            VisibleViewModelBase wm = InternalCreateNewViewModel(model);

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