>>t1.Arrange(new Rect(bs.Point1, new Point(12, 12))); >>//instead of >>t1.Arrange(new Rect(bs.Point1.X, bs.Point1.Y, 12, 12));Lord knows what I was expecting that constructor version to do :-{
public class ThumbPoints >>> { >>> public Thumb Thumb1; >>> public Thumb Thumb2; >>> public Thumb Thumb3; >>> public PathSegment Segment; >>> } >>> >>> public class PathAdorner : Adorner >>> { >>> List<ThumbPoints> ThumbPoints; >>> VisualCollection visualChildren; >>> >>> public PathAdorner(UIElement adornedElement) : base(adornedElement) >>> { >>> visualChildren = new VisualCollection(this); >>> ThumbPoints = new List<ThumbPoints>(); >>> PathGeometry g = (PathGeometry)((Path)adornedElement).Data; >>> foreach (PathFigure item in g.Figures) >>> { >>> foreach (PathSegment seg in item.Segments) >>> { >>> if (seg is LineSegment) >>> { >>> ThumbPoints pseg = new ThumbPoints(); >>> pseg.Segment = seg; >>> BuildAdornerPoint(ref pseg.Thumb1, Cursors.Hand); >>> ThumbPoints.Add(pseg); >>> } >>> else if (seg is BezierSegment) >>> { >>> ThumbPoints pseg = new ThumbPoints(); >>> pseg.Segment = seg; >>> BuildAdornerPoint(ref pseg.Thumb1, Cursors.Hand); >>> ThumbPoints.Add(pseg); >>> } >>> } >>> } >>> } >>> >>> protected override Size ArrangeOverride(Size finalSize) >>> { >>> foreach (ThumbPoints item in ThumbPoints) >>> { >>> if (item.Segment is LineSegment) >>> { >>> LineSegment line = (LineSegment)item.Segment; >>> item.Thumb1.Arrange(new Rect(line.Point.X - 5, line.Point.Y - 5,10,10)); >>> } >>> else if (item.Segment is BezierSegment) >>> { >>> BezierSegment line = (BezierSegment)item.Segment; >>> item.Thumb1.Arrange(new Rect(line.Point3.X - 5, line.Point3.Y - 5, 10, 10)); >>> } >>> } >>> return finalSize; >>> } >>> >>> void BuildAdornerPoint(ref Thumb pointThumb, Cursor customizedCursor) >>> { >>> if (pointThumb != null) return; >>> pointThumb = new Thumb(); >>> pointThumb.Cursor = customizedCursor; >>> pointThumb.Height = pointThumb.Width = 10; >>> pointThumb.Opacity = 0.40; >>> pointThumb.Background = new SolidColorBrush(Colors.MediumBlue); >>> visualChildren.Add(pointThumb); >>> } >>> >>> // Override the VisualChildrenCount and GetVisualChild properties to interface with >>> // the adorner's visual collection. >>> protected override int VisualChildrenCount { get { return visualChildren.Count; } } >>> protected override Visual GetVisualChild(int index) { return visualChildren[index]; } >>> }>