If header/footer containing annotations is set to a document using RadDocumentEditor.ChangeSectionHeader or ChangeSectionFooter methods, the annotations in the body of the header/footer are not paired in the resulting document.
When such document is exported to XAML, NullReferenceException is thrown in the ReindexAnnotationMarkers internal method.
Workaround:
- Do not use RadDocumentEditor to set the footer:
//editor.ChangeSectionFooter(radDocument.Sections.First, HeaderFooterType.Default, new Footer { Body = footerRadDocument });
radDocument.Sections.First.Footers.Default.Body = footerRadDocument;
- Manually "fix" the cloned footer body before the export:
((ISupportInitialize)radDocument.Sections.First.Footers.Default.Body).EndInit();