示例#1
0
        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;
            }
        }
示例#2
0
        private static void TextChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TextEditorEx ctl = (TextEditorEx)d;

            ctl.Text = (string)e.NewValue;
        }