Improve RadRichTextBox loading time - vb.net example?

1 Answer 92 Views
RichTextBox
Johnathan
Top achievements
Rank 1
Johnathan asked on 31 Jan 2022, 05:34 PM

   I'm attempting to following the instructions at https://docs.telerik.com/devtools/wpf/controls/radrichtextbox/mef to improve the loading time of the RadRichTextBox control.  However the given example is in c#.  I've tried to convert that over to vb.net but I can't seem to find the right assemblies.  

For example:

RadCompositionInitializer.Catalog = new TypeCatalog( // format providers typeof(XamlFormatProvider), typeof(RtfFormatProvider), typeof(DocxFormatProvider));

trying:

Imports Telerik
Imports Telerik.Windows.Documents.UI.Extensibility

 

Dim oTest as RadCompositionInitializer.Catalog = new TypeCatalog( typeof(XamlFormatProvider), typeof(RtfFormatProvider), typeof(DocxFormatProvider))

 

RadCompositionInitializer seems to come from Telerik.Windows.Documents.UI.Extensibility, but RadCompsitionInitializer.Catalog is unknown and TypeCatalog is unknown. Anyone have success in implementing this in vb.net? Many thanks!

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 03 Feb 2022, 09:13 AM

Hi Johnathan,

In addition to the dependencies of RadRichTextBox, you should also add a reference to the System.ComponentModel.Composition.dll assembly. Then, you should be able to resolve all of the imports. Here is the code you can use in VB.NET to set the catalog:

Imports Telerik.Windows.Controls.RichTextBoxUI
Imports Telerik.Windows.Controls.RichTextBoxUI.Dialogs
Imports Telerik.Windows.Documents
Imports Telerik.Windows.Documents.FormatProviders.Html
Imports Telerik.Windows.Documents.FormatProviders.OpenXml.Docx
Imports Telerik.Windows.Documents.FormatProviders.Pdf
Imports Telerik.Windows.Documents.FormatProviders.Rtf
Imports Telerik.Windows.Documents.FormatProviders.Txt
Imports Telerik.Windows.Documents.FormatProviders.Xaml
Imports Telerik.Windows.Documents.Proofing

Class MainWindow

    Public Sub New()
        UI.Extensibility.RadCompositionInitializer.Catalog = New ComponentModel.Composition.Hosting.TypeCatalog(
            GetType(XamlFormatProvider),
            GetType(RtfFormatProvider),
            GetType(DocxFormatProvider),
            GetType(PdfFormatProvider),
            GetType(HtmlFormatProvider),
            GetType(TxtFormatProvider),
            GetType(SelectionMiniToolBar),
            GetType(ImageMiniToolBar),
            GetType(Telerik.Windows.Controls.RichTextBoxUI.ContextMenu),
            GetType(RadEn_USDictionary),
            GetType(AddNewBibliographicSourceDialog),
            GetType(ChangeEditingPermissionsDialog),
            GetType(CodeFormattingDialog),
            GetType(EditCustomDictionaryDialog),
            GetType(FindReplaceDialog),
            GetType(FloatingBlockPropertiesDialog),
            GetType(FontPropertiesDialog),
            GetType(ImageEditorDialog),
            GetType(InsertCaptionDialog),
            GetType(InsertCrossReferenceWindow),
            GetType(InsertDateTimeDialog),
            GetType(InsertTableDialog),
            GetType(InsertTableOfContentsDialog),
            GetType(ManageBibliographicSourcesDialog),
            GetType(ManageBookmarksDialog),
            GetType(ManageStylesDialog),
            GetType(NotesDialog),
            GetType(ProtectDocumentDialog),
            GetType(RadInsertHyperlinkDialog),
            GetType(RadInsertSymbolDialog),
            GetType(RadParagraphPropertiesDialog),
            GetType(SectionColumnsDialog),
            GetType(SetNumberingValueDialog),
            GetType(SpellCheckingDialog),
            GetType(StyleFormattingPropertiesDialog),
            GetType(TableBordersDialog),
            GetType(TablePropertiesDialog),
            GetType(TabStopsPropertiesDialog),
            GetType(UnprotectDocumentDialog),
            GetType(WatermarkSettingsDialog),
            GetType(PasteOptionsPopup),
            GetType(CheckBoxPropertiesDialog),
            GetType(DatePickerPropertiesDialog),
            GetType(DropDownListPropertiesDialog),
            GetType(PlainTextPropertiesDialog),
            GetType(RichTextPropertiesDialog),
            GetType(RepeatingSectionPropertiesDialog),
            GetType(PicturePropertiesDialog))

        InitializeComponent()

    End Sub
End Class

Hope this is helpful.

Regards,
Tanya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Johnathan
Top achievements
Rank 1
commented on 03 Feb 2022, 05:25 PM

Thank you Tanya that was extremely helpful!  Working perfectly now!  You may want to update the documentation page at:  https://docs.telerik.com/devtools/wpf/controls/radrichtextbox/mef?_ga=2.116928462.958075451.1643647357-1980934232.1612544354&_gac=1.53070170.1643147321.CjwKCAiA3L6PBhBvEiwAINlJ9Dcy_hFmubXgE6rnSIEmLH8mSFNOjwQpDmw8fGe4IBFZ5D2tQvlEeRoCLvsQAvD_BwE to add the VB.net code and let others know that they need to add a reference to System.ComponentModel.Composition.dll.  That page shows up in Google queries.  Thanks for all the help and have a great day!
Tanya
Telerik team
commented on 04 Feb 2022, 11:17 AM

Hi Johnathan,

I completely agree with you and the change is already in progress. I hope it will be live with the next upload of the documentation site.

Hope this will make the information easier to understand.

Tags
RichTextBox
Asked by
Johnathan
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or