private static void OnBindableSelectionStartChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args) { TextEditorEx textBox = dependencyObject as TextEditorEx; if (!textBox._changeFromUi) { int newValue = (int)args.NewValue; textBox.SelectionStart = newValue; } else { textBox._changeFromUi = false; } }
private static void TextChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { TextEditorEx ctl = (TextEditorEx)d; ctl.Text = (string)e.NewValue; }