954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Implementing newline for xml-textblock display in xaml

Hi all,

I have a textblock that is bound to an xml document. This displays the innertext of an xml-node element and the width of the textblock is fixed at "auto". The issue is that of the display as the innertext may exceed the width of the textblock and therefore it doesn't implement a newline operation automatically.
For instance the textblock is in a grid bound to a the xml document:

<TextBlock Text="{Binding XPath=instructions}" Width="auto"/>


The xml document is as such:

<recipetype>
<instructions>(1) You will need 2 eggs, 1 tbspn butter, margarine and all that good stuff. Then you get a pan and do like this and that..blahblahblah...</instructions>
</recipetype>


How can I format the display of this in a textblock that implements a newline when the innertext of the xml exceeds the textblock width?

I am coding in xaml as partially c#. Xaml is preferred however c# is welcomed.

Thanks

ibdatx
Light Poster
32 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: