/// <summary> /// The dependency property for has changed. /// Chnage the <seealso cref="SolidColorBrush"/> to be used for highlighting the current editor line /// in the particular <seealso cref="EdiView"/> control. /// </summary> /// <param name="d"></param> /// <param name="e"></param> private static void OnCurrentLineBackgroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { EdiView view = d as EdiView; if (view != null && e != null) { SolidColorBrush newValue = e.NewValue as SolidColorBrush; if (newValue != null) { view.AdjustCurrentLineBackground(newValue); } } }
/// <summary> /// Raises the <see cref="OptionChanged"/> event. /// </summary> private static void OnOptionsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { EdiView view = d as EdiView; if (view != null && e != null) { TextEditorOptions newValue = e.NewValue as TextEditorOptions; if (newValue != null) { view.Options = newValue; } } }
private static void OnSyntaxHighlightingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { EdiView view = d as EdiView; if (view == null || e == null) { return; } IHighlightingDefinition newValue = e.NewValue as IHighlightingDefinition; if (newValue != null) { view.SyntaxHighlighting = newValue; view.SetFolding(newValue); } }