You use of
FormattedText
is a good thing, and Simon's fix to is is quite correct, I'll vote my 5.
However, I have just one note: you might need to think of some alternative. Let's see. What you do is really good if you want what I would call "Message box effect": 1) you want to have your text word-wrapped around end-of-lines, auto-formatted, 2) you want your text to get formatted into some neat bounding box, with reasonable and pleasant aspect ratio albeit not precise, depending on the string content. This way, you may actually create your own message box or something else.
In other cases, there is a simpler way. You can use
System.Windows.Window.SizeToContent
property having your windows and all its children to size according to content (in you case, ultimately to your string content) automatically, just using this property and appropriate layout.
See
http://msdn.microsoft.com/en-us/library/system.windows.window.sizetocontent.aspx[
^].
—SA