I have the following XAML code:
<Window x:Class='RichText_Wrapping.Window1' xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' Title='Window1'> <Grid> <RichTextBox Height='100' Margin='2' Name='richTextBox1'> <FlowDocument> <Paragraph> This is a RichTextBox - if you don't specify a width, the text appears in a single column </Paragraph> </FlowDocument> </RichTextBox> </Grid>
… If you create this window in XAML, you can see that when you don’t specify a width for the window, it wraps the text in a single column, one letter at a time. Is there something I’m missing? If it’s a known deficiency in the control, is there any workaround?
Try binding the FlowDocument’s width (one way) to the width of the container RichTextBox.
Worked for me…