internal PolyLineVertexThumb(IPolyLineCanvasItem polyLine, int vertexIndex) { if (polyLine == null) { throw new ArgumentNullException(nameof(polyLine)); } PolyLine = polyLine; VertexIndex = vertexIndex; DragDelta += PolyLineVertexThumb_DragDelta; DragStarted += PolyLineVertexThumb_DragStarted; DragCompleted += PolyLineVertexThumb_DragCompleted; }
public PolyLineVerticesAdorner(IPolyLineCanvasItem adornedObject) : base(adornedObject) { CollectionChangedEventManager.AddHandler(adornedObject.Points, (sender, e) => { switch (e.Action) { case NotifyCollectionChangedAction.Add: case NotifyCollectionChangedAction.Remove: case NotifyCollectionChangedAction.Reset: ResetThumbs(); break; case NotifyCollectionChangedAction.Move: case NotifyCollectionChangedAction.Replace: Debug.Assert(e.NewItems.Count == 1); //Debug.Print("Load VT {0} -- {1}", vertexThumbs.GetHashCode(), vertexThumbs.Count); if (vertexThumbs.Count > e.OldStartingIndex) { vertexThumbs[e.OldStartingIndex].RefreshPosition(); } break; } }); }