public void AddMesh() { MeshViewModel mesh = new MeshViewModel(); MeshList.Add(mesh); RootLevel.Add(mesh); }
private void Drop(MeshViewModel child) { if (child.Parent != null) { child.SetNewParent(null); RootLevel.Add(child); } }
private void Mesh_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Parent") { //clean the root RootLevel.Where(x => x.Parent != null).ToList().All(x => RootLevel.Remove(x)); // add the mesh to the root if necessary if (((MeshViewModel)sender).Parent == null && !RootLevel.Contains(((MeshViewModel)sender))) { RootLevel.Add((MeshViewModel)sender); } } }
public void AddUnsupportedNode(UnsupportedCommand unsupportedCommand) { var counterNode = RootLevel.OfType <UnsupportedCounter>().FirstOrDefault(); if (counterNode == null) { counterNode = new UnsupportedCounter(); RootLevel.Add(counterNode); } counterNode.Count(unsupportedCommand); var level = CurrentLevelNodes; var container = level.OfType <UnsupportedContainer>().FirstOrDefault(); if (container == null) { container = new UnsupportedContainer(); level.Insert(0, container); } container.Add(new UnsupportedNode(unsupportedCommand)); }