Exemplo n.º 1
0
        private static void OnIsSpellCheckEnabledPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            RichTextEditor richEditor = (RichTextEditor)o;
            bool           value      = (bool)e.NewValue;

            richEditor.RichTextBox.SpellCheck.IsEnabled = value;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }