void ContentEditor_IsEnabledChanged(object sender, System.Windows.DependencyPropertyChangedEventArgs e) { // Maintain focus on the text editor. if ((bool)e.NewValue) { Dispatcher.BeginInvoke(new Action(() => ContentEditor.Focus())); } }