#252 – FlowDocument Flows its Content Automatically
March 21, 2011 Leave a comment
A FlowDocument automatically flows its content to fit its current size. In the example below, we include a FlowDocument in a FlowDocumentScrollViewer:
<FlowDocumentScrollViewer> <FlowDocument FontFamily="Cambria" FontSize="14"> <Paragraph> There was no possibility of taking a walk that day. We had been wandering, indeed, in the leafless shrubbery an hour in the morning; but since dinner (Mrs. Reed, when there was no company, dined early) the cold winter wind had brought with it clouds so sombre, and a rain so penetrating, that further out-door exercise was now out of the question. </Paragraph> <Paragraph> I was glad of it: I never liked long walks, .. etc. etc.
At runtime, the content will flow/wrap to fit the current window:
Also note that the text is automatically justified–both the left and right sides of the paragraph are lined up.