Answer the question
In order to leave comments, you need to log in
WPF. How to position a TextBlock element with the text 'text' in the C# code with indent from the edge 'x' and 'y'?
There is a Path element. There is a certain GeometryGroup in which the graph is drawn.
There is a certain TextBlock (an array with the names of the vertices).
Question. How to set text in a TextBlock and position it at certain coordinates (above vertices, for example (vertex coordinates are known)) from C# code?
Answer the question
In order to leave comments, you need to log in
something like this
var graph = new GeometryGroup();
var text = new FormattedText("12345",
CultureInfo.CurrentCulture,
FlowDirection.LeftToRight,
new Typeface("Verdana"),
32,
Brushes.Black);
graph.Children.Add(text.BuildGeometry(new Point(5, 5));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question