public DragablePointViewModel InsertPoint(Point insertMe, DragablePointViewModel insertBeforeMe) { DragablePoint np = new DragablePoint(1, insertMe.X - PosX, insertMe.Y - PosY); DragablePointViewModel newPoint = new DragablePointViewModel(MainVm, this, np); int index = 0; if (insertBeforeMe != null) { index = PointVms.IndexOf(insertBeforeMe); } if (index >= 0) { PointVms.Insert(index, newPoint); } if (insertBeforeMe != null) { PolygonObject.InsertPoint(newPoint.ModelObject, insertBeforeMe.ModelObject); } else { PolygonObject.InsertPoint(newPoint.ModelObject, null); } OnPropertyChanged(""); Parent.OnPropertyChanged(""); return(newPoint); }
public DragablePointViewModel AddPoint(Point point) { DragablePoint np = new DragablePoint(1, point.X, point.Y); DragablePointViewModel newPoint = new DragablePointViewModel(MainVm, this, np); PointVms.Add(newPoint); PolygonObject.AddPoint(newPoint.ModelObject); OnPropertyChanged(""); Parent.OnPropertyChanged(""); return(newPoint); }
public void InsertPoint(DragablePoint insertMe, DragablePoint insertBeforeMe) { int index = 0; if (insertBeforeMe != null) { index = Points.IndexOf(insertBeforeMe); } if (index >= 0) { Points.Insert(index, insertMe); } }
public void RemovePoint(DragablePoint point) { Points.Remove(point); }
public void AddPoint(DragablePoint point) { Points.Add(point); }