Approved
Last Updated: 31 Oct 2018 08:11 by ADMIN
ADMIN
Petya
Created on: 14 Aug 2015 08:46
Category: RichTextBox
Type: Bug Report
0
RichTextBox: Handling the import of InlineUIContainers from HTML is impossible
Currently, exporting to HTML serializes the containers by exporting them to XAML and adding them in a comment in the HTML. There are InlineUIContainerImporting and InlineUIContainerImported events, but the Handled property of the importing event arguments is read-only. This prevents users from creating their own serialization/deserialization logic.

Steps to reproduce:
1. Subscribe to events of the format provider:

            HtmlFormatProvider prov = DocumentFormatProvidersManager.GetProviderByExtension("html") as HtmlFormatProvider;
            prov.ExportSettings.InlineUIContainerExporting += ExportSettings_InlineUIContainerExporting;
            prov.ImportSettings.InlineUIContainerImporting += ImportSettings_InlineUIContainerImporting;
            prov.ImportSettings.InlineUIContainerImported += ImportSettings_InlineUIContainerImported;

2. Insert inline UI container in the document and export it to HTML. InlineUIContainerExporting event is raised and you can set the CommentContent property of the args to custom value.
3. Import the document back in the control

Expected: It should be possible to set the Handled property of the importing event args to true, and assign your desired value to the InlineUIContainer property.
Actual: InlineUIContainerImporting event is raised, but all properties of the event arguments have private setters.
0 comments