ibdatx 0 Light Poster

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:

<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>

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.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.