private static void OnIsSpellCheckEnabledPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { RichTextEditor richEditor = (RichTextEditor)o; bool value = (bool)e.NewValue; richEditor.RichTextBox.SpellCheck.IsEnabled = value; }
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); }
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); }
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); }
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); }
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); }
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); } }