I am trying to find this out for days already without luck, what i want to achieve is to add flowdocument xaml code from string. String like:
string test = "<Paragraph><Run>Text</Run></Paragraph>";
But i want to add it not at the end of the block or document, but at current caret position. I need it to be able to enable copying of UIElements across my RichTextbox.
Thanks for help !
The XAML text like
<Paragraph><Run>Text</Run></Paragraph>can't be inserted to theFlowDocumentdirectly.It should be converted to proper Flow Related Classes.
In your case create the
Paragraphobject and insert it on the current caret position:The
MainWindows.xaml:The
MainWindow.xaml.cs: