private static void OnSelectionIsNumberingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichEditorControl richEditorControl = (RichEditorControl)d;

            if (richEditorControl._updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            EditingCommands.ToggleNumbering.Execute(null, richEditorControl.RichTextBox);
            richEditorControl.OnSelectionChanged(null, null);
        }
        private static void OnSelectionParagraphIsRightToLeftPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichEditorControl richEditorControl = (RichEditorControl)d;

            if (richEditorControl._updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            richEditorControl.RichTextBox.Selection.ApplyPropertyValue(Paragraph.FlowDirectionProperty, (value == true) ? FlowDirection.RightToLeft : FlowDirection.LeftToRight);
            richEditorControl.OnSelectionChanged(null, null);
        }
        private static void OnSelectionIsAlignJustifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichEditorControl richEditorControl = (RichEditorControl)d;

            if (richEditorControl._updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            richEditorControl.RichTextBox.Selection.ApplyPropertyValue(Paragraph.TextAlignmentProperty, (value == true) ? TextAlignment.Justify : TextAlignment.Left);
            richEditorControl.OnSelectionChanged(null, null);
        }
        private static void OnSelectionIsUnderlinePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichEditorControl richEditorControl = (RichEditorControl)d;

            if (richEditorControl._updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            richEditorControl.RichTextBox.Selection.ApplyPropertyValue(Inline.TextDecorationsProperty, (value == true) ? System.Windows.TextDecorations.Underline : null);
            richEditorControl.OnSelectionChanged(null, null);
        }
        private static void OnSelectionIsItalicPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichEditorControl richEditorControl = (RichEditorControl)d;

            if (richEditorControl._updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            richEditorControl.RichTextBox.Selection.ApplyPropertyValue(TextElement.FontStyleProperty, (value == true) ? FontStyles.Italic : FontStyles.Normal);
            richEditorControl.OnSelectionChanged(null, null);
        }
        private static void OnSelectionFontSizePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichEditorControl richEditorControl = (RichEditorControl)d;

            if (richEditorControl._updateSelectionPropertiesPending)
            {
                return;
            }
            string value = (string)e.NewValue;

            if (value != null)
            {
                richEditorControl.RichTextBox.Selection.ApplyPropertyValue(TextElement.FontSizeProperty, value);
                richEditorControl.OnSelectionChanged(null, null);
            }
        }