예제 #1
0
        private static void OnIsSpellCheckEnabledPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            RichTextEditor richEditor = (RichTextEditor)o;
            bool           value      = (bool)e.NewValue;

            richEditor.RichTextBox.SpellCheck.IsEnabled = value;
        }
예제 #2
0
        private static void OnSelectionIsNumberingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichTextEditor richEditor = (RichTextEditor)d;

            if (richEditor.m_updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            EditingCommands.ToggleNumbering.Execute(null, richEditor.RichTextBox);
            richEditor.OnSelectionChanged(null, null);
        }
예제 #3
0
        private static void OnSelectionParagraphIsRightToLeftPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichTextEditor richEditor = (RichTextEditor)d;

            if (richEditor.m_updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            richEditor.RichTextBox.Selection.ApplyPropertyValue(Paragraph.FlowDirectionProperty, (value == true) ? FlowDirection.RightToLeft : FlowDirection.LeftToRight);
            richEditor.OnSelectionChanged(null, null);
        }
예제 #4
0
        private static void OnSelectionIsAlignJustifyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichTextEditor richEditor = (RichTextEditor)d;

            if (richEditor.m_updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            richEditor.RichTextBox.Selection.ApplyPropertyValue(Paragraph.TextAlignmentProperty, (value == true) ? TextAlignment.Justify : TextAlignment.Left);
            richEditor.OnSelectionChanged(null, null);
        }
예제 #5
0
        private static void OnSelectionIsUnderlinePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichTextEditor richEditor = (RichTextEditor)d;

            if (richEditor.m_updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            richEditor.RichTextBox.Selection.ApplyPropertyValue(Inline.TextDecorationsProperty, (value == true) ? System.Windows.TextDecorations.Underline : null);
            richEditor.OnSelectionChanged(null, null);
        }
예제 #6
0
        private static void OnSelectionIsItalicPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichTextEditor richEditor = (RichTextEditor)d;

            if (richEditor.m_updateSelectionPropertiesPending)
            {
                return;
            }
            bool value = (bool)e.NewValue;

            richEditor.RichTextBox.Selection.ApplyPropertyValue(TextElement.FontStyleProperty, (value == true) ? FontStyles.Italic : FontStyles.Normal);
            richEditor.OnSelectionChanged(null, null);
        }
예제 #7
0
        private static void OnSelectionFontSizePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            RichTextEditor richEditor = (RichTextEditor)d;

            if (richEditor.m_updateSelectionPropertiesPending)
            {
                return;
            }
            string value = (string)e.NewValue;

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