tags:

views:

46

answers:

1

Hi all. Te question is how to add text to path element. For example, I have path:

        Path firstPath = new Path();
        firstPath.Stroke = Brushes.Black;
        firstPath.StrokeThickness = 1;

        myCanvas.Children.Add(firstPath);

        LineGeometry firstLine = new LineGeometry();
        firstPath.Data = firstLine;

And somewhere I define line's Start and End point's. The path is binded to controls (for example - two ellipses) and when I drag one of them, the line is dynamically resized and moved to be pinned to both objects.

And now I wand to add some text, that would fit to this line and follow it. Any recommendations how to do this?

+1  A: 

http://msdn.microsoft.com/en-us/magazine/dd263097.aspx

Dave Swersky
That is a great article. But I need some less complicated. For example, i have a line (path, or object of LineGeometry... it don't give a meter). And I need to attach some text, that should been located in the middle of the line (binded to it, so if the line where moving, the text moves with it).
Pritorian