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

Converting XAML to Microsoft format using MsRichTextBoxXamlFormatProvider (Hyperlinks Missing)

1 Answer 54 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Eric Langland
Top achievements
Rank 1
Eric Langland asked on 03 Nov 2011, 08:02 PM
I'm using a RadRichTextBox to edit some data which will eventually end up in a windows phone app. I noticed that the native XAML format that is generated by the Rad control doesn't render in standard Microsoft XAML controls so I'm using the
Telerik.Windows.Documents.FormatProviders.MsRichTextBoxXaml.MsRichTextBoxXamlFormatProvider 

formatter to translate the XAML into the format that works for me. The problem I'm seeing is that when I translate the XAML, Hyperlinks seem to go missing. It just creates blue underlined text instead of giving me actual hyperlink XAML.

Here's the code I'm using to translate the XAML.
MsRichTextBoxXamlFormatProvider provider = new MsRichTextBoxXamlFormatProvider();              
string xaml = provider.Export(rtbBody.Document);

Any ideas?

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 04 Nov 2011, 04:01 PM
Hi Eric Langland,

Currently exporting hyperlinks to MS RichTextBox's XAML is indeed not supported. One of the reasons is that there is a difference in the document models that does not allow exact parallel between the two Hyperlink types.
RadDocument's hyperlinks are presented in the document by two inline document elements marking the start and end of the hyperlink - HyperlinkRangeStart and HyperlinkRangeEnd. This allows that hyperlinks span more than one block (Paragraph, TableCell, etc.) and there can be other inline elements between them (e.g. images). The document structure is best illustrated in the scheme on this page. This is not supported in MS FlowDocument, where Hyperlinks are inline elements.

We will consider introducing some kind of conversion, but proper behavior in all cases will probably be impossible to achieve.

Kind regards,
Iva Toteva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Eric Langland
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or