public void CloneView(ViewCloner viewCloner) { var newVariantNode = GetNewVariantNode(viewCloner); ActivateVariant(newVariantNode); View.SetModel(newVariantNode.View); }
private IModelVariant GetNewVariantNode(ViewCloner viewCloner) { IModelListView clonedView = GetClonedView(viewCloner.Caption); var modelViewVariants = ((IModelViewVariants)_rootView); IModelVariants modelVariants = modelViewVariants.Variants; var newVariantNode = modelVariants.AddNode <IModelVariant>(); modelVariants.Current = newVariantNode; newVariantNode.Caption = viewCloner.Caption; newVariantNode.Id = viewCloner.Caption; newVariantNode.View = clonedView; return(newVariantNode); }