Text Justification using PathListBox
We have an applicaiton where we have to draw text on various curved lines. We have been evaluating using the PathListBox class from sample on Microsoft Design Tutorial PathListBox.
We have the basics running as shown in the demo and it works well. Our pro开发者_JS百科blem is that we need to be able to center the text on the path and we do not see a way to do this. Normal justification doesn't work in this case because each letter is drawn as it's own ListBoxItem with a TextBlock as the template along the path.
Suggestions
There doesn't seem to be an immediate way of achieving this.
There is the Start
property, which will determine the point (as a percentage) at which the items start to be displayed. You could use this to center static content, but if the text is subject to change, it won't work.
If you have Blend, you can easily create a copy of the template and inspect and modify it. I'd look to see if the actual container holding those TextBlock
s is inside something else, and if it is, you might be able to set its alignment to center.
精彩评论