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

Font Changes Crashing Silverlight?

9 Answers 101 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 30 Nov 2011, 11:14 PM
Hello, and let me start by apologizing if this issue has been delt with previously, i have skimmed through and searched and not found an answer, so i thought i'd post.

My problem is that when an amount of text, doesn't seem to matter how much is selected in RadRichTextBox, and the font family or size changed, the whole silverlight app seems to lock up.  This is the only thing that causes this behaviour currently.

Any insight you can provide is much appreciated.

Thanks,

Darren

9 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 01 Dec 2011, 01:14 PM
Hello Darren,

We are not aware of such an issue and I was not able to reproduce it with any of the versions of the control
or our online demo (which uses Q3 2011 - 2011.3.1116).
Could you provide some more details on your set-up? For example, do you have custom UI to apply the font changes and do you bind the content of the document in any way?
Some code snippets or a sample project will be greatly appreciated.

Kind regards,
Iva Toteva
the Telerik team

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

0
Darren
Top achievements
Rank 1
answered on 01 Dec 2011, 03:24 PM
I am using the RadRichtextbox as part of an editing system.
I have setup a new UserControl with the RadRichtextBox so that i could get the XAML the same in all instances where i use it and not have to copy & paste the XAML into different places.
I then set the content in code via a few methods.

I've included my UserControl XAML and it's code behind below:

Here is my XAML:
<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"  x:Class="VirtualCoachingAdmin.Views.RichText.RichTextControl"
    mc:Ignorable="d"
    d:DesignHeight="768" d:DesignWidth="1024">
     
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
 
        <telerik:RadRichTextBoxRibbonUI ApplicationButtonImageSource="/RichTextBox;component/Images/RichTextBox/MSOffice/AppIcon-telerik.png"
                                        ApplicationName="Virtual Coaching Editor"
                                        DataContext="{Binding Path=Commands, ElementName=editor}"
                                        Name="radRichTextBoxRibbonUI"
                                        IsMouseWheelTabScrollingEnabled="False"
                                        >
            <telerik:RadRichTextBoxRibbonUI.Resources>
                <telerik:FontFamiliesProvider x:Key="FontFamiliesProvider" />
            </telerik:RadRichTextBoxRibbonUI.Resources>
            <telerik:RadRichTextBoxRibbonUI.ApplicationMenu>
                <telerik:ApplicationMenu Height="267">
                    <telerik:ApplicationMenu.Content>
                        <StackPanel Width="230" />
                    </telerik:ApplicationMenu.Content>
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/new.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=NewDocumentCommand}" Size="Large" Text="New" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/open.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=OpenDocumentCommand}" Size="Large" Text="Open" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/save.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Size="Large" Text="Save" />
                    <telerik:RadRibbonSplitButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/saveas.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Size="Large" Text="Save As">
                        <telerik:RadRibbonSplitButton.DropDownContent>
                            <StackPanel HorizontalAlignment="Stretch">
                                <telerik:RadGroupHeader Content="Save as" />
                                <telerik:RadRibbonButton CommandParameter="docx" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Width="292">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/worddoc.png" Stretch="None" />
                                        <StackPanel>
                                            <TextBlock FontWeight="Bold" Text="Word Document" />
                                            <TextBlock Text="Save the file as a Word document." TextWrapping="Wrap" Width="220" />
                                        </StackPanel>
                                    </StackPanel>
                                </telerik:RadRibbonButton>
                                <telerik:RadRibbonButton CommandParameter="pdf" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Width="292">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/Pdf.png" Stretch="None" />
                                        <StackPanel>
                                            <TextBlock FontWeight="Bold" Text="PDF Document" />
                                            <TextBlock Text="Save document as a PDF file." TextWrapping="Wrap" Width="220" />
                                        </StackPanel>
                                    </StackPanel>
                                </telerik:RadRibbonButton>
                                <telerik:RadRibbonButton CommandParameter="html" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Width="292">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/html.png" Stretch="None" />
                                        <StackPanel>
                                            <TextBlock FontWeight="Bold" Text="Html Document" />
                                            <TextBlock Text="Save the file as a Html document." TextWrapping="Wrap" Width="220" />
                                        </StackPanel>
                                    </StackPanel>
                                </telerik:RadRibbonButton>
                                <telerik:RadRibbonButton CommandParameter="rtf" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Width="292">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/Rtf.png" Stretch="None" />
                                        <StackPanel>
                                            <TextBlock FontWeight="Bold" Text="Rich Text Format" />
                                            <TextBlock Text="Save document in Rich Text Format." TextWrapping="Wrap" Width="220" />
                                        </StackPanel>
                                    </StackPanel>
                                </telerik:RadRibbonButton>
                                <telerik:RadRibbonButton CommandParameter="txt" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Width="292">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/PlainText.png" Stretch="None" />
                                        <StackPanel>
                                            <TextBlock FontWeight="Bold" Text="Plain text" />
                                            <TextBlock Text="Save document in plain text format." TextWrapping="Wrap" Width="220" />
                                        </StackPanel>
                                    </StackPanel>
                                </telerik:RadRibbonButton>
                                <telerik:RadRibbonButton CommandParameter="xaml" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Width="292">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/Xaml.png" Stretch="None" />
                                        <StackPanel>
                                            <TextBlock FontWeight="Bold" Text="Xaml Document" />
                                            <TextBlock Text="Save document as a xaml file." TextWrapping="Wrap" Width="220" />
                                        </StackPanel>
                                    </StackPanel>
                                </telerik:RadRibbonButton>
                            </StackPanel>
                        </telerik:RadRibbonSplitButton.DropDownContent>
                    </telerik:RadRibbonSplitButton>
                    <telerik:RadRibbonSplitButton CommandParameter="Html" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/print.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=PrintCommand}" Size="Large" Text="Print">
                        <telerik:RadRibbonSplitButton.DropDownContent>
                            <StackPanel HorizontalAlignment="Stretch">
                                <telerik:RadGroupHeader Content="Print" />
                                <telerik:RadRibbonButton CommandParameter="Html" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=PrintCommand}" Width="292">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/print.png" Stretch="None" />
                                        <StackPanel>
                                            <TextBlock FontWeight="Bold" Text="Html print" />
                                            <TextBlock Text="Select a printer, number of copies before printing." TextWrapping="Wrap" Width="220" />
                                        </StackPanel>
                                    </StackPanel>
                                </telerik:RadRibbonButton>
                                <telerik:RadRibbonButton CommandParameter="Native" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=PrintCommand}" Width="292">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/pagesetup.png" Stretch="None" />
                                        <StackPanel>
                                            <TextBlock FontWeight="Bold" Text="Native Print" />
                                            <TextBlock Text="Send the document directly to the default printer without making changes." TextWrapping="Wrap" Width="220" />
                                        </StackPanel>
                                    </StackPanel>
                                </telerik:RadRibbonButton>
                                <telerik:RadRibbonButton CommandParameter="HtmlPreview" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=PrintCommand}" Width="292">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/ApplicationMenu/print_preview.png" Stretch="None" />
                                        <StackPanel>
                                            <TextBlock FontWeight="Bold" Text="Print Preview" />
                                            <TextBlock Text="Preview and make changes to pages before printing." TextWrapping="Wrap" Width="220" />
                                        </StackPanel>
                                    </StackPanel>
                                </telerik:RadRibbonButton>
                            </StackPanel>
                        </telerik:RadRibbonSplitButton.DropDownContent>
                    </telerik:RadRibbonSplitButton>
                </telerik:ApplicationMenu>
            </telerik:RadRichTextBoxRibbonUI.ApplicationMenu>
            <telerik:RadRichTextBoxRibbonUI.QuickAccessToolBar>
                <telerik:QuickAccessToolBar>
                    <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/save.png" Text="Save" />
                    <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=UndoCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/undo.png" Text="Undo" />
                    <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=RedoCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/redo.png" Text="Redo" />
                </telerik:QuickAccessToolBar>
            </telerik:RadRichTextBoxRibbonUI.QuickAccessToolBar>
            <telerik:RadRibbonTab Header="Home">
                <telerik:RadRibbonGroup Header="Clipboard">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Medium" />
                    </telerik:RadRibbonGroup.Variants>
                    <StackPanel>
                        <telerik:RadRibbonButton CollapseToSmall="WhenGroupIsMedium" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=CutCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/cut.png" Text="Cut" />
                        <telerik:RadRibbonButton CollapseToSmall="WhenGroupIsMedium" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=CopyCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/copy.png" Text="Copy" />
                        <telerik:RadRibbonButton CollapseToSmall="WhenGroupIsMedium" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=PasteCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/paste.png" Text="Paste" />
                    </StackPanel>
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup DialogLauncherVisibility="Visible" Header="Font" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowFontPropertiesDialogCommand}">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="2" Variant="Medium" />
                        <telerik:GroupVariant Priority="4" Variant="Small" />
                        <telerik:GroupVariant Priority="5" Variant="Collapsed" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadOrderedWrapPanel>
                        <StackPanel Orientation="Horizontal">
                            <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}" Width="132" IsMouseWheelEnabled="False" />
                            <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" IsMouseWheelEnabled="False">
                                <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>
                        </StackPanel>
                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=IncrementFontSizeCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/font-increasesize.png" />
                            <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=DecrementFontSizeCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/font-decreasesize.png" />
                        </telerik:RadButtonGroup>
                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ClearFormattingCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/ClearFormatting16.png" />
                        </telerik:RadButtonGroup>
                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonToggleButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleBoldCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/bold.png" />
                            <telerik:RadRibbonToggleButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleItalicCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/italic.png" />
                            <telerik:RadRibbonSplitButton IsToggle="True" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleUnderlineCommand}" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/underline.png">
                                <telerik:RadRibbonSplitButton.DropDownContent>
                                    <telerik:RadGallery ItemHeight="26" ItemWidth="156" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeUnderlineDecorationCommand}" ViewportHeight="210" ViewportWidth="157">
                                        <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/underline1.png" Tag="Line" />
                                        <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/underline2.png" Tag="DoubleLine" />
                                        <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/underline3.png" Tag="ThickLine" />
                                        <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/underline4.png" Tag="DottedLine" />
                                        <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/underline5.png" Tag="DashedLine" />
                                        <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/underline6.png" Tag="DotDashedLine" />
                                        <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/underline7.png" Tag="DotDotDashedLine" />
                                        <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/underline8.png" Tag="Wave" />
                                    </telerik:RadGallery>
                                </telerik:RadRibbonSplitButton.DropDownContent>
                            </telerik:RadRibbonSplitButton>
                            <telerik:RadRibbonToggleButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleStrikethroughCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/Strikethrough16.png" />
                            <telerik:RadRibbonToggleButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleSubscriptCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/subscript.png" />
                            <telerik:RadRibbonToggleButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleSuperscriptCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/superscript.png" />
                        </telerik:RadButtonGroup>
                        <telerik:RadButtonGroup>
                            <telerik:HighlightColorPicker AutomaticColor="Transparent" Height="22" Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/highlight.png" NoColorText="No color" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeFontHighlightColorCommand}" SelectedColor="Yellow" />
                            <telerik:HighlightColorPicker Height="22" Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/FontForeColor.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeFontForeColorCommand}" SelectedColor="Red" />
                        </telerik:RadButtonGroup>
                    </telerik:RadOrderedWrapPanel>
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup DialogLauncherVisibility="Visible" Header="Paragraph" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowParagraphPropertiesDialogCommand}">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="1" Variant="Medium" />
                        <telerik:GroupVariant Priority="3" Variant="Collapsed" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadOrderedWrapPanel>
                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonToggleButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleBulletsCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/list-bullets.png" />
                            <telerik:RadRibbonToggleButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleNumberedCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/list-numbered.png" />
                            <telerik:RadRibbonDropDownButton Size="Small" SmallImage="/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 Path=ChangeListStyleCommand}" ViewportHeight="176" ViewportWidth="266">
                                            <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListNone.png" Tag="None" />
                                            <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListBulleted.png" Tag="Bulleted" />
                                            <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListNumbered.png" Tag="Numbered" />
                                            <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListNumberedParenthesis.png" Tag="NumberedParenthesis" />
                                            <telerik:RadGalleryItem Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/MultilevelListNumberedHierarchical.png" Tag="NumberedHierarchical" />
                                        </telerik:RadGallery>
                                    </StackPanel>
                                </telerik:RadRibbonDropDownButton.DropDownContent>
                            </telerik:RadRibbonDropDownButton>
                        </telerik:RadButtonGroup>
                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=DecrementParagraphLeftIndentCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/outdent.png" />
                            <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=IncrementParagraphLeftIndentCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/indent.png" />
                        </telerik:RadButtonGroup>
                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonToggleButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleFormattingSymbolsCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/formatting-symbols.png" />
                        </telerik:RadButtonGroup>
                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonToggleButton CommandParameter="Left" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeTextAlignmentCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/alignleft.png" Text="Align Left" />
                            <telerik:RadRibbonToggleButton CommandParameter="Center" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeTextAlignmentCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/aligncenter.png" Text="Center" />
                            <telerik:RadRibbonToggleButton CommandParameter="Right" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeTextAlignmentCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/alignright.png" Text="Align Right" />
                            <telerik:RadRibbonToggleButton CommandParameter="Justify" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeTextAlignmentCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/alignjustify.png" Text="Justify" />
                        </telerik:RadButtonGroup>
                        <telerik:RadButtonGroup>
                            <telerik:HighlightColorPicker AutomaticColor="Transparent" Height="20" Image="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/ParagraphBackgroundColor.png" NoColorText="No color" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeParagraphBackgroundColorCommand}" SelectedColor="Transparent" />
                        </telerik:RadButtonGroup>
                    </telerik:RadOrderedWrapPanel>
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Editing & Proofing">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Medium" />
                    </telerik:RadRibbonGroup.Variants>
                    <StackPanel>
                        <telerik:RadRibbonButton CollapseToSmall="WhenGroupIsMedium" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowFindReplaceDialogCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/Find.png" Text="Find/Replace" />
                        <telerik:RadRibbonToggleButton CollapseToSmall="WhenGroupIsMedium" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleSpellCheckingCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/EnableSpellCheck.png" Text="Enable Spell Check" />
                        <telerik:RadRibbonButton CollapseToSmall="WhenGroupIsMedium" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=OpenContextMenuOnNextSpellingErrorCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/FindNextSpellingError.png" Text="Find Next Error" />
                    </StackPanel>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Insert">
                <telerik:RadRibbonGroup Header="Pages">
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageBreak.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertPageBreakCommand}" Size="Large" Text="Page Break" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Tables">
                    <telerik:RadRibbonDropDownButton CollapseToMedium="WhenGroupIsMedium" Command="{Binding Path=InsertTableCommand}" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertTable.png" Size="Large" Text="Insert">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <StackPanel>
                                <telerik:RadRibbonButton ClickMode="Press">
                                    <telerik:TableSizePicker Command="{Binding Path=InsertTableCommand}" />
                                </telerik:RadRibbonButton>
                                <telerik:RadMenuItem IsSeparator="True" />
                                <telerik:RadRibbonButton HorizontalAlignment="Stretch" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowInsertTableDialogCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/InsertTable.png" Text="Insert Table..." />
                            </StackPanel>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Illustrations">
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/Picture.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertPictureCommand}" Size="Large" Text="Picture" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Links">
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/inserthyperlink.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowInsertHyperlinkDialogCommand}" Size="Large" Text="Hyperlink" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertBookmark.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowManageBookmarksDialogCommand}" Size="Large" Text="Bookmark" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Symbols">
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/Symbol.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowInsertSymbolWindowCommand}" Size="Large" Text="Symbol" />
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Page Layout">
                <telerik:RadRibbonGroup Header="Page Setup">
                    <telerik:RadRibbonDropDownButton CollapseToMedium="WhenGroupIsMedium" Command="{Binding Path=ChangePaperTypeCommand}" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageSize.png" Size="Large" Text="Size">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadGallery ItemWidth="184" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangePaperTypeCommand}" ViewportWidth="185">
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="A0">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="A0" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (33.05" x 46.78")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="A1">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="A1" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (23.39" x 33.05")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="A2">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="A2" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (16.53" x 23.39")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="A3">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="A3" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (11.7" x 16.53")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="A4">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="A4" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (8.26" x 11.7")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="A5">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="A5" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (5.83" x 8.26")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="RA0">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="RA0" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (33.86" x 48.03")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="RA1">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="RA1" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (24.01" x 33.86")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="RA2">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="RA2" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (16.93" x 24.01")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="RA3">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="RA3" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (12.01" x 16.93")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="RA4">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="RA4" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (8.46" x 12.01")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="RA5">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="RA5" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (4.76" x 8.46")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="B0">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="B0" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (39.38" x 55.67")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="B1">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="B1" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (27.83" x 39.38")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="B2">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="B2" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (59.05" x 19.68")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="B3">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="B3" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (13.91" x 19.68")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="B4">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="B4" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (10.13" x 14.33")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="B5">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="B5" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (7.17" x 10.13")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Quarto">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Quarto" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (8" x 10")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Foolscap">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Foolscap" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (8" x 13")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Executive">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Executive" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (7.5" x 10")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="GovernmentLetter">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="GovernmentLetter" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (10.5" x 8")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Letter">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Letter" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (8.5" x 11")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Legal">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Legal" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (8.5" x 14")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Ledger">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Ledger" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (17" x 11")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Tabloid">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Tabloid" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (11" x 17")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Post">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Post" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (15.64" x 19.25")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Crown">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Crown" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (20" x 15")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="LargePost">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="LargePost" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (16.5" x 21")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Demy">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Demy" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (17.5" x 22")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Medium">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Medium" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (18" x 23")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Royal">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Royal" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (20" x 25")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Elephant">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Elephant" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (21.74" x 28")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="DoubleDemy">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="DoubleDemy" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (23.5" x 35")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="QuadDemy">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="QuadDemy" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (35" x 45")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="STMT">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="STMT" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (5.5" x 8.5")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Folio">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Folio" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (8.5" x 13")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Statement">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Statement" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (5.5" x 8.5")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Size10x14">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock FontWeight="Bold" Text="Size10x14" VerticalAlignment="Center" />
                                        <TextBlock FontWeight="Normal" Text=" (10" x 14")" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                            </telerik:RadGallery>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                    <telerik:RadRibbonDropDownButton CollapseToMedium="WhenGroupIsMedium" Command="{Binding Path=ChangePageMarginsCommand}" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageMargin.png" Size="Large" Text="Margins">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadGallery ItemHeight="54" ItemWidth="114" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangePageMarginsCommand}" ViewportHeight="270" ViewportWidth="115">
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Normal">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/PageMarginNormal.png" Stretch="None" />
                                        <TextBlock FontWeight="Bold" Text="Normal" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Narrow">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/PageMarginNarrow.png" Stretch="None" />
                                        <TextBlock FontWeight="Bold" Text="Narrow" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Moderate">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/PageMarginModerate.png" Stretch="None" />
                                        <TextBlock FontWeight="Bold" Text="Moderate" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Wide">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/PageMarginWide.png" Stretch="None" />
                                        <TextBlock FontWeight="Bold" Text="Wide" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Office2003">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/PageMarginNormal.png" Stretch="None" />
                                        <TextBlock FontWeight="Bold" Text="Office2003" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                            </telerik:RadGallery>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                    <telerik:RadRibbonDropDownButton CollapseToMedium="WhenGroupIsMedium" Command="{Binding Path=ChangePageOrientationCommand}" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientation.png" Size="Large" Text="Orientation">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadGallery ItemHeight="54" ItemWidth="109" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangePageOrientationCommand}" ViewportHeight="216" ViewportWidth="110">
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Portrait">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientationPortrait.png" Stretch="None" />
                                        <TextBlock FontWeight="Bold" Text="Portrait" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Rotate90">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientationLandscape.png" Stretch="None" />
                                        <TextBlock FontWeight="Bold" Text="Landscape" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Rotate180">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientationRotate180.png" Stretch="None" />
                                        <TextBlock FontWeight="Bold" Text="Rotate 180" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                                <telerik:RadGalleryItem HorizontalContentAlignment="Left" Tag="Rotate270">
                                    <StackPanel Orientation="Horizontal">
                                        <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageOrientationRotate270.png" Stretch="None" />
                                        <TextBlock FontWeight="Bold" Text="Rotate 270" VerticalAlignment="Center" />
                                    </StackPanel>
                                </telerik:RadGalleryItem>
                            </telerik:RadGallery>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="View">
                <telerik:RadRibbonGroup Header="Document Views">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="2" Variant="Medium" />
                        <telerik:GroupVariant Priority="8" Variant="Collapsed" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonButton CollapseToMedium="WhenGroupIsMedium" CollapseToSmall="WhenGroupIsSmall" CommandParameter="Flow" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/web-C.PNG" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeLayoutModeCommand}" Size="Large" Text="Web Layout" />
                    <telerik:RadRibbonButton CollapseToMedium="WhenGroupIsMedium" CollapseToSmall="WhenGroupIsSmall" CommandParameter="Paged" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PageBreak.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeLayoutModeCommand}" Size="Large" Text="Print Layout" />
                    <telerik:RadRibbonButton CollapseToMedium="WhenGroupIsMedium" CollapseToSmall="WhenGroupIsSmall" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/properties32.png" Size="Large" Text="Show Statistics" Click="Statistics_Click"  />
                    <telerik:RadRibbonButton CollapseToMedium="WhenGroupIsMedium" CollapseToSmall="WhenGroupIsSmall" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/inspectdocument.png" Size="Large" Text="Document Structure" Click="ViewDocumentStructure_Click" />
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Review">
                <telerik:RadRibbonGroup Header="Proofing">
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/EnableSpellCheck.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowSpellCheckingDialogCommand}" Size="Large" Text="Spell Check" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Comments">
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/NewComment.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertCommentCommand}" Size="Large" Text="New Comment" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/DeleteComment.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=DeleteCommentCommand}" Size="Large" Text="Delete" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/PreviousComment.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=GoToPreviousCommentCommand}" Size="Large" Text="Previous" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/NextComment.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=GoToNextCommentCommand}" Size="Large" Text="Next" />
                    <telerik:RadRibbonToggleButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/ShowHideComments.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ToggleCommentsCommand}" Size="Large" Text="Show/Hide Comments" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/DeleteAllComments.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=DeleteAllCommentsCommand}" Size="Large" Text="Delete All" />
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="Table">
                <telerik:RadRibbonGroup Header="Table">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="2" Variant="Medium" />
                        <telerik:GroupVariant Priority="8" Variant="Collapsed" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonDropDownButton CollapseToMedium="WhenGroupIsMedium" Command="{Binding Path=InsertTableCommand}" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertTable.png" Size="Large" Text="Insert">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <StackPanel>
                                <telerik:RadRibbonButton ClickMode="Press">
                                    <telerik:TableSizePicker Command="{Binding Path=InsertTableCommand}" />
                                </telerik:RadRibbonButton>
                                <telerik:RadMenuItem IsSeparator="True" />
                                <telerik:RadRibbonButton HorizontalAlignment="Stretch" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowInsertTableDialogCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/InsertTable.png" Text="Insert Table..." />
                            </StackPanel>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/DeleteTable.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=DeleteTableCommand}" Size="Large" Text="Delete" />
                    <telerik:RadRibbonDropDownButton CollapseToMedium="WhenGroupIsMedium" Command="{Binding Path=SelectTableEmptyCommand}" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/SelectTableTools.png" Size="Large" Text="Select">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <StackPanel>
                                <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SelectTableCellCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/SelectTableCell.png" Text="Select Cell" />
                                <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SelectTableColumnCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/SelectTableColumn.png" Text="Select Column" />
                                <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SelectTableRowCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/SelectTableRow.png" Text="Select Row" />
                                <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SelectTableCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/SelectTable.png" Text="Select Table" />
                            </StackPanel>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/TableProperties.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ShowTablePropertiesDialogCommand}" Size="Large" Text="Properties" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Rows">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="2" Variant="Medium" />
                        <telerik:GroupVariant Priority="8" Variant="Collapsed" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertTableRow.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertTableRowCommand}" Size="Large" Text="Insert Row" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertTableRowBelow.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertTableRowBelowCommand}" Size="Large" Text="Insert Below" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertTableRowAbove.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertTableRowAboveCommand}" Size="Large" Text="Insert Above" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/DeleteTableRows.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=DeleteTableRowCommand}" Size="Large" Text="Delete Row" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Columns">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="2" Variant="Medium" />
                        <telerik:GroupVariant Priority="8" Variant="Collapsed" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertTableColumn.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertTableColumnCommand}" Size="Large" Text="Insert Column" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertTableColumnToTheLeft.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertTableColumnToTheLeftCommand}" Size="Large" Text="Insert Left" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/InsertTableColumnToTheRight.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=InsertTableColumnToTheRightCommand}" Size="Large" Text="Insert Right" />
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/DeleteTableColumns.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=DeleteTableColumnCommand}" Size="Large" Text="Delete Column" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Merge">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="2" Variant="Medium" />
                        <telerik:GroupVariant Priority="8" Variant="Collapsed" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonButton LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/MergeTableCells.png" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=MergeTableCellsCommand}" Size="Large" Text="Merge Cells" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Cell Size">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="2" Variant="Medium" />
                        <telerik:GroupVariant Priority="8" Variant="Collapsed" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonDropDownButton CollapseToMedium="WhenGroupIsMedium" Command="{Binding Path=SelectTableEmptyCommand}" LargeImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/32/AutoFit.png" Size="Large" Text="AutoFit">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <StackPanel>
                                <telerik:RadRibbonButton CommandParameter="AutoFit" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeTableColumnsLayoutModeCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/AutoFItToWindow.png" Text="AutoFit to Window" />
                                <telerik:RadRibbonButton CommandParameter="Fixed" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=ChangeTableColumnsLayoutModeCommand}" Size="Medium" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/FixedColumnWidth.png" Text="Fixed Column Width" />
                            </StackPanel>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Alignment">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="1" Variant="Medium" />
                        <telerik:GroupVariant Priority="3" Variant="Collapsed" />
                    </telerik:RadRibbonGroup.Variants>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <telerik:RadToggleButton CommandParameter="Left,Top" CornerRadius="3" Grid.Column="0" Grid.Row="0" IsBackgroundVisible="False" IsTabStop="False" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=TableCellContentAlignmentCommand}">
                            <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/LeftTopCellAlignment.png" Stretch="None" />
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton CommandParameter="Center,Top" CornerRadius="3" Grid.Column="1" Grid.Row="0" IsBackgroundVisible="False" IsTabStop="False" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=TableCellContentAlignmentCommand}">
                            <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/CenterTopCellAlignment.png" Stretch="None" />
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton CommandParameter="Right,Top" CornerRadius="3" Grid.Column="2" Grid.Row="0" IsBackgroundVisible="False" IsTabStop="False" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=TableCellContentAlignmentCommand}">
                            <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/RightTopCellAlignment.png" Stretch="None" />
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton CommandParameter="Left,Center" CornerRadius="3" Grid.Column="0" Grid.Row="1" IsBackgroundVisible="False" IsTabStop="False" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=TableCellContentAlignmentCommand}">
                            <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/LeftMiddleCellAlignment.png" Stretch="None" />
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton CommandParameter="Center,Center" CornerRadius="3" Grid.Column="1" Grid.Row="1" IsBackgroundVisible="False" IsTabStop="False" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=TableCellContentAlignmentCommand}">
                            <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/CenterMiddleCellAlignment.png" Stretch="None" />
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton CommandParameter="Right,Center" CornerRadius="3" Grid.Column="2" Grid.Row="1" IsBackgroundVisible="False" IsTabStop="False" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=TableCellContentAlignmentCommand}">
                            <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/RightMiddleCellAlignment.png" Stretch="None" />
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton CommandParameter="Left,Bottom" CornerRadius="3" Grid.Column="0" Grid.Row="2" IsBackgroundVisible="False" IsTabStop="False" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=TableCellContentAlignmentCommand}">
                            <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/LeftBottomCellAlignment.png" Stretch="None" />
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton CommandParameter="Center,Bottom" CornerRadius="3" Grid.Column="1" Grid.Row="2" IsBackgroundVisible="False" IsTabStop="False" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=TableCellContentAlignmentCommand}">
                            <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/CenterBottomCellAlignment.png" Stretch="None" />
                        </telerik:RadToggleButton>
                        <telerik:RadToggleButton CommandParameter="Right,Bottom" CornerRadius="3" Grid.Column="2" Grid.Row="2" IsBackgroundVisible="False" IsTabStop="False" telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=TableCellContentAlignmentCommand}">
                            <Image Source="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/RightBottomCellAlignment.png" Stretch="None" />
                        </telerik:RadToggleButton>
                    </Grid>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
        </telerik:RadRichTextBoxRibbonUI>
 
        <telerik:DocumentRuler AssociatedRichTextBox="{Binding ElementName=editor, Mode=OneTime}" Grid.Row="1"/>
        <telerik:RadRichTextBox Grid.Row="1" x:Name="editor" Margin="24 24 0 0" AllowDrop="True" Drop="editor_Drop" ShowComments="True"/>
        <telerik:RadRichTextBoxStatusBar Grid.Row="2" AssociatedRichTextBox="{Binding ElementName=editor, Mode=OneTime}"/>
 
 
    </Grid>
</UserControl>

Code Behind:
using System;
 
using System.Collections.Generic;
 
using System.Linq;
 
using System.Net;
 
using System.Windows;
 
using System.Windows.Controls;
 
using System.Windows.Documents;
 
using System.Windows.Input;
 
using System.Windows.Media;
 
using System.Windows.Media.Animation;
 
using System.Windows.Shapes;
 
using Telerik.Windows.Controls.RichTextBoxUI.Dialogs;
 
using Telerik.Windows.Controls.RichTextBoxUI;
 
using Telerik.Windows.Documents.Proofing;
 
using System.Globalization;
 
using Telerik.Windows.Documents.Model;
 
using Telerik.Windows.Documents.Layout;
 
using Telerik.Windows.Controls;
 
using System.IO;
 
using Telerik.Windows.Documents.FormatProviders.Html;
 
using Telerik.Windows.Documents.FormatProviders.Rtf;
 
using Telerik.Windows.Documents.FormatProviders;
 
using Telerik.Windows.Documents.FormatProviders.Txt;
 
using VirtualCoachingAdmin.Tools;
 
  
 
namespace VirtualCoachingAdmin.Views.RichText
 
{
 
    public partial class RichTextControl : UserControl
 
    {
 
        public RichTextControl()
 
        {
 
            InitializeComponent();
 
        }
 
  
 
        public RadDocument RadDocument
 
        {
 
            get
 
            {
 
                return this.editor.Document;
 
            }
 
            set
 
            {
 
                SetupNewDocument(value);
 
                this.editor.Document = value;
 
            }
 
        }
 
  
 
        public void setContent(string Content)
 
        {
 
            try
 
            {
 
                if (String.IsNullOrEmpty(Content))
 
                {
 
                    RadDocument = new RadDocument();
 
                    return;
 
                }
 
                IDocumentFormatProvider provider = null;
 
                if (Content.Contains("<html") || Content.Contains("<body") || Content.Contains("<p") || Content.Contains("<b"))
 
                {
 
                    provider = new HtmlFormatProvider();
 
                    if (provider != null && provider.CanImport)
 
                        RadDocument = ((HtmlFormatProvider)provider).Import(Content);
 
                }
 
                else if (Content.Contains("{\\rtf") || Content.Contains("{\rtf"))
 
                {
 
                    provider = new RtfFormatProvider();
 
                    if (provider != null && provider.CanImport)
 
                        RadDocument = ((RtfFormatProvider)provider).Import(Content);
 
                }
 
                else
 
                {
 
                    provider = new TxtFormatProvider();
 
                    if (provider != null && provider.CanImport)
 
                        RadDocument = ((TxtFormatProvider)provider).Import(Content);
 
                }
 
            }
 
            catch (Exception ex)
 
            {
 
                MainPage.Instance._syncContext.Send(new System.Threading.SendOrPostCallback(Utils.PrintDebug), ex);
 
            }
 
        }
 
  
 
        public string getContent()
 
        {
 
            try
 
            {
 
                RtfFormatProvider provider = new RtfFormatProvider();
 
                return provider.Export(RadDocument);
 
            }
 
            catch (Exception ex)
 
            {
 
                MainPage.Instance._syncContext.Send(new System.Threading.SendOrPostCallback(Utils.PrintDebug), ex);
 
                return null;
 
            }
 
        }
 
  
 
        private void SetupNewDocument(RadDocument document)
 
        {
 
            document.LayoutMode = DocumentLayoutMode.Paged;
 
            document.ParagraphDefaultSpacingAfter = 10;
 
            document.PageViewMargin = new SizeF(10, 10);
 
            document.SectionDefaultPageMargin = new Padding(95);
 
        }
 
  
 
        private bool IsSupportedImageFormat(string extension)
 
        {
 
            if (extension != null)
 
            {
 
                extension = extension.ToLower();
 
            }
 
  
 
            return extension == ".jpg" ||
 
                extension == ".jpeg" ||
 
                extension == ".png" ||
 
                extension == ".bmp";
 
        }
 
  
 
        private void Statistics_Click(object sender, RoutedEventArgs e)
 
        {
 
            string statistics = this.editor.Document.GetStatisticsInfo().ToString();
 
            MessageBox.Show(statistics, "Document Statistics", MessageBoxButton.OK);
 
        }
 
  
 
        private void editor_Drop(object sender, DragEventArgs e)
 
        {
 
            FileInfo[] droppedFiles = e.Data.GetData(DataFormats.FileDrop) as FileInfo[];
 
  
 
            foreach (FileInfo droppedFile in droppedFiles)
 
            {
 
                if (this.IsSupportedImageFormat(droppedFile.Extension))
 
                {
 
                    using (Stream imageStream = droppedFile.OpenRead())
 
                    {
 
                        this.editor.InsertImage(imageStream, droppedFile.Extension);
 
                    }
 
                }
 
            }
 
        }
 
  
 
    }
 
}

Here's how i implement in the classes:
public static RichTextControl rtb = new RichTextControl();
 
rtb.setContent(Content);

The RichTextControl is only created once and is used everywhere... so i'm starting to think this might be causing the problem....   Not sure why the Control would have a problem with just switching content, though.


Thanks in advance for any suggestions


0
Darren
Top achievements
Rank 1
answered on 01 Dec 2011, 04:12 PM
As a test, i've changed my code so that everytime a new RadRichTextBox is used, the program creates a new one. 

No change.  All that is needed to crash it is a "ctrl+a" and a couple font changes.
0
Darren
Top achievements
Rank 1
answered on 01 Dec 2011, 05:12 PM
Also, i'm currently running version 2011.2.920.1040.

I see that there is a newer version, so i'll attempt to update and see if that helps.
0
Darren
Top achievements
Rank 1
answered on 02 Dec 2011, 03:56 PM
Well, i've updated to the newest version of the Silverlight controls: 2011.3.1116.1040.

The editor still does the same thing, however i've isolated it to a single area that it's doing it in.

I'm getting an error whenever doing a "ctrl+a" + <operation>

for example, even just using ctrl+a to highlight everything and then hitting the delete key to remove all the text from the editor will make it crash.

The error i'm getting is a "Key not found in Dictionary" exception

My code loads up correctly and the only time it crashes is when using the Telerik editor unfortuneately...

Any suggestions are appreciated...


Also, the other 2 areas where i use the telerik editor are fine, and don't have this problem.
0
Iva Toteva
Telerik team
answered on 07 Dec 2011, 09:58 AM
Hi Darren,

We were not able to reproduce the issue.
However, judging from your description, the exception is probably related to the document you are viewing in this particular RadRichTextBox instance. Could you share the content that you are setting in the following method:
rtb.setContent(Content);

so that we can try to reproduce it.
If you could prepare a sample project illustrating the problem, it would be even better.
Looking forward to your reply.

Kind regards,
Iva Toteva
the Telerik team

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

0
Darren
Top achievements
Rank 1
answered on 07 Dec 2011, 05:04 PM
Hi,

I've figured out the problem.  It related to reuse of the control.  apparently, the control does not like being reused and only the content being changed.

I have adjusted my code to make a new control in each section needed and it seems to be working properly now.

Sorry for not updating this sooner.

Thanks for looking into it for me.
0
Darren
Top achievements
Rank 1
answered on 07 Dec 2011, 09:44 PM
Apparently that didn't actually fix it completely, it only made the situation better.

Is there a way to capture and read errors that RadRichTextBox might be encountering?

My Silverlight app just stops responding when this happens.
0
Iva Toteva
Telerik team
answered on 12 Dec 2011, 07:24 PM
Hi Darren,

You can debug your application and set it to break on every exception. This can be done in visual studio from the toolbar: Debug -> Exceptions -> Common Language Runtime Exceptions -> check User-unhandled. For command errors, you can handle the CommandError event and retrieve the exception that has occurred from the event args.

You could also pause debugging and see the method that is currently executed, as well as the stacktrace up to that point, in case the hang is due to an endless cycle of sorts.

Once again, it would be easier if you could open a support ticket and attach a repro project, so that we can debug it on our end and find the cause of the problem.

Best wishes,
Iva Toteva
the Telerik team

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

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