Hi,
I am editing some code and using WPF Diagramming. I have a ShapeNode and I would like to show some aligned wrapped additional text above the shape.
I have this code to set additional text:
public void DrawNode(DrawingContext a_Context, FontFamily a_FontFamily, FontStretch a_FontStretch)
{
Typeface tface = new Typeface(a_FontFamily, FontStyle, FontWeight, a_FontStretch);
Point txtLocation = new Point(5, 65);
FormattedText text = new FormattedText("Additional text that is located above",
CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
tface, FontSize, Brushes.Black);
a_Context.DrawText(text, txtLocation);
}
But the "Additional text that is located above" is not alligned and wrapped.
If I change proprties TextAlignment and TextWrapping in the DrowNode function it is just changing formating of the "Main text of node".
...
FormattedText text = new FormattedText("Additional text that is located above",
CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
tface, FontSize, Brushes.Black);
TextAlignment = System.Windows.TextAlignment.Center;
TextWrapping = System.Windows.TextWrapping.Wrap;
a_Context.DrawText(formtxt, txtLocation);
}
How can I achieve formatting of an additional text?