Example #1
0
        public BaseObjectCollectionViewModel(
            IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
            IObjectCollectionValueModel <TModelCollection> mdl)
            : base(appCtx, dataCtx, parent, mdl)
        {
            ObjectCollectionModel = mdl;

            if (ObjectCollectionModel.RelEnd != null)
            {
                var rel = ObjectCollectionModel.RelEnd.Parent;
                if (rel != null)
                {
                    var otherEnd = rel.GetOtherEnd(ObjectCollectionModel.RelEnd);
                    if (otherEnd != null && otherEnd.Multiplicity.UpperBound() > 1 && rel.Containment != ContainmentSpecification.Independent)
                    {
                        AllowAddExisting = false;
                        AllowRemove      = false;
                    }
                    else if (rel.GetRelationType() == RelationType.n_m)
                    {
                        AllowAddNew = false;
                        AllowAddNewWhenAddingExisting = true;
                    }
                }
            }
            dataCtx.IsElevatedModeChanged += new EventHandler(dataCtx_IsElevatedModeChanged);
        }
Example #2
0
 public ObjectCollectionViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     IObjectCollectionValueModel <ICollection <IDataObject> > mdl)
     : base(appCtx, dataCtx, parent, mdl)
 {
 }
Example #3
0
 public RelationChainViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     IObjectCollectionValueModel<IList<IDataObject>> mdl)
     : base(appCtx, dataCtx, parent, mdl)
 {
 }
Example #4
0
 public DestinationPropertyViewModel(
     IViewModelDependencies appCtx, IZetboxContext dataCtx, ViewModel parent,
     IObjectCollectionValueModel <IList <IDataObject> > mdl)
     : base(appCtx, dataCtx, parent, mdl)
 {
 }