Beispiel #1
0
        public ChildObjectViewModel(
            TreeViewViewModel treeParent,
            CompoundObjectViewModel parentVm,
            MainViewModel mainVm,
            ChildObject modelObject,
            bool enabled = true) :
            base(treeParent, parentVm, mainVm, enabled)
        {
            ModelObject = modelObject;

            foreach (TStateProperties <ChildObjectStateProperties> cosp in ModelObject.StateProperties)
            {
                ChildCOViewModel cospvm = new ChildCOViewModel(this, parentVm, mainVm, cosp, enabled);
                StateProperties.Add(cospvm);

                // Since this COVM is the child of another COVM we need to check if the COVM
                // is a reference to a file or not. If it is, the children of the COVM shall
                // not be selectable, i.e. they shall be disabled. If it it is not a file ref
                // it shall be selectable.
                if (cospvm.IsFileReferenceChild)
                {
                    cospvm.BuildViewModel(false);
                }
                else
                {
                    cospvm.BuildViewModel(true);
                }
            }
        }
 public BoxedSpritePolygonViewModel(MainViewModel mainVm, CompoundObjectViewModel parent, BoxedSpritePolygon modelObject) :
     base(mainVm, parent, modelObject)
 {
     MainVm        = mainVm;
     ModelObject   = modelObject;
     PolygonObject = (EditablePolygon)ModelObject;
 }
        public ChildObjectViewModel(
            TreeViewViewModel treeParent,
            CompoundObjectViewModel parentVm,
            MainViewModel mainVm,
            ChildObject modelObject,
            bool enabled = true) :
            base(treeParent, parentVm, mainVm, enabled)
        {
            ModelObject = modelObject;

            if (_modelObject.CompObj != null)
            {
                CompObj = new ChildCOViewModel(this, parentVm, mainVm, _modelObject.CompObj, enabled);
                _co.Clear();
                _co.Add(CompObj);

                if (IsFileReferenceChild)
                {
                    CompObj.BuildViewModel(false);
                }
                else
                {
                    CompObj.BuildViewModel(true);
                }
            }
            else
            {
                CompObj = null;
            }
        }
Beispiel #4
0
 public DynamicPolygonViewModel(MainViewModel mainVm, CompoundObjectViewModel parent, DynamicPolygon modelObject) :
     base(mainVm, parent, modelObject)
 {
     MainVm      = mainVm;
     Parent      = parent;
     ModelObject = modelObject;
 }
 public ShieldPropertiesViewModel(
     TreeViewViewModel treeParent,
     CompoundObjectViewModel parentVm,
     MainViewModel mainVm,
     ShieldProperties modelObject) :
     base(treeParent, parentVm, mainVm)
 {
     ModelObject = modelObject;
 }
 public SteerableObjectPropertiesViewModel(
     TreeViewViewModel treeParent,
     CompoundObjectViewModel parentVm,
     MainViewModel mainVm,
     SteerableObjectProperties modelObject,
     bool enabled = true) :
     base(treeParent, parentVm, mainVm, enabled)
 {
     ModelObject = modelObject;
 }
Beispiel #7
0
 public FileCOViewModel(
     TreeViewViewModel treeParent,
     CompoundObjectViewModel parentVm,
     MainViewModel mainVm,
     string fileName,
     CompoundObject modelObject) :
     base(treeParent, parentVm, mainVm, modelObject)
 {
     _fileName = fileName;
 }
Beispiel #8
0
 public BodyOriginSystemViewModel(
     TreeViewViewModel treeParent,
     CompoundObjectViewModel parentVm,
     MainViewModel mainVm,
     BodyOriginSystem modelObject,
     CoSystemViewModel systemViewModel) :
     base(treeParent, parentVm, mainVm, systemViewModel)
 {
     _modelObject = modelObject;
 }
 public CompoundShapesObjectViewModel(
     TreeViewViewModel treeParent,
     CompoundObjectViewModel parentVm,
     MainViewModel mainVm,
     CompoundShapesObject modelObject,
     bool enabled = true) :
     base(treeParent, parentVm, mainVm, enabled)
 {
     _shapes         = new ShapeCollectionViewModel(this, null, mainVm, enabled);
     ModelBaseObject = modelObject;
 }