public ChildCOViewModel( TreeViewViewModel treeParent, CompoundObjectViewModel parentVm, MainViewModel mainVm, TStateProperties <ChildObjectStateProperties> childStateModelObject, bool enabled = true) : base(treeParent, parentVm, mainVm, childStateModelObject.Properties.CompObj) { ChildStateModelObject = childStateModelObject; // Below we need to find the top level behavior. Must get it from the MainViewModel! int i = MainVm.GetEditableCoBehaviourIndexOf(ChildStateModelObject.State); if (i < 0) { i = 0; } SelectedStateIndex = i; }