<Path Stroke="Black"> > <Path.Data> > <PathGeometry> > <PathFigure StartPoint="0,0"> > <BezierSegment /> > </PathFigure> > </PathGeometry> > </Path.Data> > </Path>I want to use this with an AdornerLayer. At the moment I have this (which works as far as it goes when the BezierSeqment is populated)
public class PathAdorner : Adorner > { > Path p; > PathFigure pf; > BezierSegment bs; > > readonly VisualCollection _visualChildren; > > public StretchAdorner(UIElement adornedElement) > : base(adornedElement) > { > _visualChildren = new VisualCollection(this); > p = (Path)adornedElement; > PathGeometry pg = (PathGeometry) p.Data; > pf = pg.Figures[0]; > bs = (BezierSegment) pf.Segments[0]; > } > > protected override void OnRender(DrawingContext drawingContext) > { > drawingContext.DrawEllipse(new SolidColorBrush(Colors.Red), null, pf.StartPoint, 5, 5); > drawingContext.DrawEllipse(new SolidColorBrush(Colors.Green), null, bs.Point1, 5, 5); > drawingContext.DrawEllipse(new SolidColorBrush(Colors.Green), null, bs.Point2, 5, 5); > drawingContext.DrawEllipse(new SolidColorBrush(Colors.Red), null, bs.Point3, 5, 5); > } > > protected override int VisualChildrenCount { get { return _visualChildren.Count; } } > protected override Visual GetVisualChild(int index) { return _visualChildren[index]; } > }But I want to use Thumbs rather than just drawing in OnRender(). I know the principal is to create the Thumbs and add them to the VisualChildren collection and to place them in the ArrangeOverride method but can't work out how to get the correct placements.