// All children CompoundObjectViewModels are created here. The constructor of the ChildObjectViewModel
        // creates a ChildObjectStatePropertiesViewModel which's constructor creates the CompoundObjectViewModel.
        private StateChildCollectionViewModel SetChildren(CompoundObject ModelObject, bool enabledChildren = true)
        {
            StateChildCollectionViewModel schcvm = new StateChildCollectionViewModel(this, this, MainVm, enabledChildren);

            foreach (ChildObject cho in ModelObject.ChildObjects)
            {
                ChildObjectViewModel chovm = new ChildObjectViewModel(schcvm, this, MainVm, cho, enabledChildren);

                schcvm.Children.Add(chovm);
            }

            return(schcvm);
        }
        public SpawnObjectViewModel(
            TreeViewViewModel treeParent,
            CompoundObjectViewModel parentVm,
            MainViewModel mainVm,
            SpawnObject modelObject,
            bool enabled = true) :
            base(treeParent, parentVm, mainVm)
        {
            ModelObject = modelObject;

            ChildObjectViewModel chvm = new ChildObjectViewModel(this, parentVm, mainVm, modelObject.MyChildObject);

            SpawnChildObject.Add(chvm);
        }
Beispiel #3
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is ChildCOViewModel)
            {
                ChildCOViewModel     vm   = value as ChildCOViewModel;
                ChildObjectViewModel chvm = vm.TreeParent as ChildObjectViewModel;

                string s = chvm.Name + " State Properties";

                return(s);
            }

            if (value is string)
            {
                string s = (string)value + " State Properties";

                return(s);
            }

            return(null);
        }