コード例 #1
0
        public void CloneView(ViewCloner viewCloner)
        {
            var newVariantNode = GetNewVariantNode(viewCloner);

            ActivateVariant(newVariantNode);
            View.SetModel(newVariantNode.View);
        }
コード例 #2
0
        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);
        }