Hi Team,
We developing application with Prism and we need to edit the content at run time. So we used empty RadRichTextBox along with RadToolBar, we wont use any document. But it hits the performance on first time, please refer the below code.
<
telerik:RadToolBarTray
DataContext
=
"{Binding ElementName=editor, Path=Commands}"
telerik:StyleManager.Theme
=
"Windows8"
Background
=
"LightGray"
IsLocked
=
"True"
>
<
telerik:RadToolBarTray.Resources
>
<
telerik:FontFamiliesProvider
x:Key
=
"FontFamiliesProvider"
/>
</
telerik:RadToolBarTray.Resources
>
<
telerik:RadToolBar
Height
=
"32"
OverflowButtonVisibility
=
"Hidden"
>
<
telerik:RadButtonGroup
>
<
telerik:RadRibbonButton
CollapseToSmall
=
"WhenGroupIsMedium"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding CutCommand}"
Size
=
"Medium"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/cut.png"
/>
<
telerik:RadRibbonButton
CollapseToSmall
=
"WhenGroupIsMedium"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding CopyCommand}"
Size
=
"Medium"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/copy.png"
/>
<
telerik:RadRibbonButton
CollapseToSmall
=
"WhenGroupIsMedium"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding PasteCommand}"
Size
=
"Medium"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/paste.png"
/>
</
telerik:RadButtonGroup
>
<
telerik:RadToolBarSeparator
/>
<
telerik:RadButtonGroup
>
<
telerik:RadRibbonButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding UndoCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/undo.png"
Text
=
"Undo"
/>
<
telerik:RadRibbonButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding RedoCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/redo.png"
Text
=
"Redo"
/>
</
telerik:RadButtonGroup
>
<
telerik:RadToolBarSeparator
/>
<
telerik:RadButtonGroup
>
<
telerik:RadRibbonToggleButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding Path=ToggleBoldCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/bold.png"
/>
<
telerik:RadRibbonToggleButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding Path=ToggleItalicCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/italic.png"
/>
<
telerik:RadRibbonToggleButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding Path=ToggleUnderlineCommand}"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/underline.png"
/>
<
telerik:RadRibbonToggleButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding Path=ToggleStrikethroughCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/Strikethrough16.png"
/>
</
telerik:RadButtonGroup
>
<
telerik:RadButtonGroup
>
<
telerik:RadRibbonToggleButton
CommandParameter
=
"Left"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding ChangeTextAlignmentCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/alignleft.png"
Text
=
"Align Left"
/>
<
telerik:RadRibbonToggleButton
CommandParameter
=
"Center"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding ChangeTextAlignmentCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/aligncenter.png"
Text
=
"Center"
/>
<
telerik:RadRibbonToggleButton
CommandParameter
=
"Right"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding ChangeTextAlignmentCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/alignright.png"
Text
=
"Align Right"
/>
<
telerik:RadRibbonToggleButton
CommandParameter
=
"Justify"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding ChangeTextAlignmentCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/alignjustify.png"
Text
=
"Justify"
/>
</
telerik:RadButtonGroup
>
<
telerik:RadToolBarSeparator
/>
<
telerik:RadButtonGroup
>
<
telerik:RadRibbonButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding DecrementParagraphLeftIndentCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/outdent.png"
/>
<
telerik:RadRibbonButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding IncrementParagraphLeftIndentCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/indent.png"
/>
</
telerik:RadButtonGroup
>
<
telerik:RadToolBarSeparator
/>
<
telerik:RadButtonGroup
>
<
telerik:RadRibbonComboBox
CanAutocompleteSelectItems
=
"False"
CanKeyboardNavigationSelectItems
=
"False"
CommandParameter
=
"{Binding RelativeSource={RelativeSource Self}, Path=SelectedValue}"
Height
=
"21"
IsReadOnly
=
"True"
ItemsSource
=
"{Binding Source={StaticResource FontFamiliesProvider}, Path=RegisteredFonts}"
OpenDropDownOnFocus
=
"True"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding Path=ChangeFontFamilyCommand}"
telerik:ScreenTip.Description
=
"Change the font family."
telerik:ScreenTip.Title
=
"Font"
Width
=
"132"
/>
<
telerik:RadRibbonComboBox
CanAutocompleteSelectItems
=
"False"
CanKeyboardNavigationSelectItems
=
"False"
CommandParameter
=
"{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Tag}"
Height
=
"21"
IsEditable
=
"True"
IsReadOnly
=
"True"
IsTextSearchEnabled
=
"False"
OpenDropDownOnFocus
=
"True"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding Path=ChangeFontSizeCommand}"
Width
=
"45"
>
<
telerik:RadRibbonComboBoxItem
Content
=
"8"
Tag
=
"10.67"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"9"
Tag
=
"12"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"10"
Tag
=
"13.33"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"11"
Tag
=
"14.67"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"12"
Tag
=
"16"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"14"
Tag
=
"18.67"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"16"
Tag
=
"21.33"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"18"
Tag
=
"24"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"20"
Tag
=
"26.67"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"22"
Tag
=
"29.33"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"24"
Tag
=
"32"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"26"
Tag
=
"34.67"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"28"
Tag
=
"37.33"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"36"
Tag
=
"48"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"48"
Tag
=
"64"
/>
<
telerik:RadRibbonComboBoxItem
Content
=
"72"
Tag
=
"96"
/>
</
telerik:RadRibbonComboBox
>
</
telerik:RadButtonGroup
>
<
telerik:RadButtonGroup
>
<
telerik:RadRibbonToggleButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding ToggleBulletsCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/list-bullets.png"
/>
<
telerik:RadRibbonToggleButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding ToggleNumberedCommand}"
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/list-numbered.png"
/>
<
telerik:RadRibbonDropDownButton
Size
=
"Small"
SmallImage
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/MultilevelList.png"
>
<
telerik:RadRibbonDropDownButton.DropDownContent
>
<
StackPanel
>
<
telerik:RadGroupHeader
Content
=
"List Library"
/>
<
telerik:RadGallery
ItemHeight
=
"88"
ItemWidth
=
"88"
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding ChangeListStyleCommand}"
ViewportHeight
=
"176"
ViewportWidth
=
"266"
>
<
telerik:RadGalleryItem
Image
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListNone.png"
Tag
=
"None"
/>
<
telerik:RadGalleryItem
Image
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListBulleted.png"
Tag
=
"Bulleted"
/>
<
telerik:RadGalleryItem
Image
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListNumbered.png"
Tag
=
"Numbered"
/>
<
telerik:RadGalleryItem
Image
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListNumberedParenthesis.png"
Tag
=
"NumberedParenthesis"
/>
<
telerik:RadGalleryItem
Image
=
"pack://application:,,,/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListNumberedHierarchical.png"
Tag
=
"NumberedHierarchical"
/>
</
telerik:RadGallery
>
</
StackPanel
>
</
telerik:RadRibbonDropDownButton.DropDownContent
>
</
telerik:RadRibbonDropDownButton
>
</
telerik:RadButtonGroup
>
</
telerik:RadToolBar
>
</
telerik:RadToolBarTray
>
<
telerik:RadRichTextBox
Name
=
"editor"
telerik:StyleManager.Theme
=
"Windows8"
Grid.Row
=
"1"
Margin
=
"0"
FocusVisualStyle
=
"{x:Null}"
EnforcedPermissionRangeBrush
=
"Blue"
Background
=
"{x:Null}"
/>
And we have tried all possible ways that you have described in below link.
http://docs.telerik.com/devtools/wpf/controls/radrichtextbox/mef#initial-load-performance-of-radrichtextbox
Please refer the below code.
RadCompositionInitializer.Catalog =
new
TypeCatalog();
DocumentFormatProvidersManager.AutomaticallyLoadFormatProviders =
false
;
InitializeComponent();
this
.editor.UILayersBuilder =
new
UILayersBuilder();
While using the above code the loading time is reduced, but not completely. Still it takes minimum five seconds to load at first time. Please suggest any ideas to reduce the loading time completely.
Thanks,
Antony