I have a Silverlight app that adds a Path to the LayoutRoot grid of a UserControl. The path geometry is a simple rectangle.
I would like to be able to add a TextBlock that is contained within the Path that was added to the LayoutRoot grid.
I am also using a custom Adorner to allow me to resize the Path on the screen and move it around.
Basically, I want the TextBlock's parent to be the path, so that whenever I move the Path around, the TextBlock moves with it, and, also, the text within the TextBlock can never go outside the boundaries of the Path.
Here is an example of what I currently have:
var shape = new ShapeClass((o, u) => { LayoutRoot.Children.Add(o); LayoutRoot.Children.Add(u); });
Here is the constructor for the Shape class:
public ShapeClass(Action<Path, TextBlock> insert){}
Where 'o' is the Path object and 'u' is the TextBlock...
Does anyone have any ideas as to how this might be achieved?
Thanks.