I'm trying to access the contents of a FlowDocument (of a RichTextBox). I wanna do this because I want to convert the contents to a UBB formatted string (yea, the old forum formated text). Is there a way to get the contents of the FlowDocument's contents:
I know that via FlowDocuments's Blocks property you can get the Blocks inside the FlowDocument, which are itself BlockUIContainer, List, Paragraph, Section or Table objects, as can be seen here. However, if I want the LogicalChildren of Paragraph, for example, its protected and thus inaccessable. So.. This is not the way to go. What is? (I did not find another way, yet.)
Also, I know about converting the contents of a FlowDocument to XAML, etc. But the converters I found, did not include image objects and some other objects I find usefull and are displayed by the RichTextBox.
Thanks in advance!
Ah! I found the solution...
BlockUIContainer has Child which in return can contain everything else (as long as it inherents from UIElement)Inlines on a Paragraph. This returns a collection of Inline.List its called ListItems. This contains a collection of ListItem (which in return contains Blocks, thus either of these.Sections also contains BlocksTable has RowGroups which has a collection of TableRowGroup, etc. etc. etc.I've been dumb not to think about the ContentPropertyAttribute...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With