private void OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { if ((bool)e.NewValue) { Dispatcher.BeginInvoke(DispatcherPriority.Normal, () => this.RemarksTextBox.Focus()); } } }