Tuesday, December 30, 2014

Preserving whitespace in Run element

When formatting a paragraph as so -




<RichTextBlock>
<Paragraph xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>

<Run></Run>

<InlineUIContainer><TextBlock >Words here</TextBlock></InlineUIContainer>

<Run xml:space="preserve"> </Run>

<InlineUIContainer><TextBlock>More words here</TextBlock></InlineUIContainer>

<Run xml:space="preserve"> Lastly some words here</Run>

</Paragraph>
</RichTextBlock>

The <Run> element containing a single space is never displayed and ignore the space=preserve property. However the last run with a leading space is displayed correctly.


How can I get a run containing a single space to display ?


No comments:

Post a Comment