This is a migrated thread and some comments may be shown as answers.

How to display XAML documents exported from RichTextBox in FlowDocumentReader?

1 Answer 130 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 22 Aug 2013, 09:44 PM
When a document is exported from RichTextBox into XAML it cannot be displayed in FlowDocumentReader control.

I looked at the exported XAML and the root element is <t:RadDocument>. This cannot be displayed in FlowDocumentReader control. I tried enclosing this within <FlowDocument> element but that did not help...

Anyway, how do I display XAML document exported by RichTextBox in FlowDocumentReader control? Or can this XAML genarated by RichTextBox only be displayed by the Telerik RadRichTextBox control?

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 27 Aug 2013, 01:12 PM
Hello Dean,

Thank you for contacting us about this issue!

You can export RadRichTextBox Document to FlowDocument by adding reference to Telerik.Windows.Documents.FormatProviders.MsRichTextBox.Xaml.dll and using an instance of MsRichTextBoxXamlFormatProvider. The following code snippet shows how exactly you can achieve that:

MsRichTextBoxXamlFormatProvider xamlProvider = new MsRichTextBoxXamlFormatProvider();
System.Windows.Documents.FlowDocument flowDocument = xamlProvider.ExportToFlowDocument(this.radRichTextBox.Document);

I hope this helps! If you have any other questions or concerns please do not hesitate to contact us again!

Regards,
Deyan
the Telerik team
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RichTextBox
Asked by
Dean
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or