public LfDragablePointViewModel( TreeViewViewModel treeParent, CompoundObjectViewModel parentVm, MainViewModel mainVm, LfPolygonViewModel parent, LfDragablePoint modelObject, bool enabled = true) : base(treeParent, parentVm, mainVm, enabled) { MainVm = mainVm; Parent = parent; ModelObject = modelObject; IsSelected = false; }
public void InsertPoint(LfDragablePoint insertMe, LfDragablePoint insertBeforeMe) { int index = 0; if (insertBeforeMe != null) { index = Points.IndexOf(insertBeforeMe); } if (index >= 0) { Points.Insert(index, insertMe); } }
public LfDragablePointViewModel AddPoint(Point point) { if (LocalModelObject == null) { return(null); } LfDragablePoint np = new LfDragablePoint(GetFreeVertexIndex(), point.X, point.Y); LfDragablePointViewModel newPoint = new LfDragablePointViewModel(this, ParentVm, MainVm, this, np); PointVms.Add(newPoint); LocalModelObject.AddPoint(newPoint.ModelObject); InvalidateAll(); ParentVm.OnPropertyChanged(""); return(newPoint); }
public LfDragablePointViewModel InsertPoint(Point insertMe, LfDragablePointViewModel insertBeforeMe) { if (LocalModelObject == null) { return(null); } LfDragablePoint np = new LfDragablePoint(GetFreeVertexIndex(), insertMe.X, insertMe.Y); LfDragablePointViewModel newPoint = new LfDragablePointViewModel(this, ParentVm, MainVm, this, np); int index = 0; if (insertBeforeMe != null) { index = PointVms.IndexOf(insertBeforeMe); } if (index >= 0) { PointVms.Insert(index, newPoint); } if (insertBeforeMe != null) { LocalModelObject.InsertPoint(newPoint.ModelObject, insertBeforeMe.ModelObject); } else { LocalModelObject.InsertPoint(newPoint.ModelObject, null); } InvalidateAll(); ParentVm.OnPropertyChanged(""); return(newPoint); }
public void RemovePoint(LfDragablePoint point) { Points.Remove(point); }
public void AddPoint(LfDragablePoint point) { Points.Add(point); }