private void ExecuteAcceptLineNumber(object sender, ExecutedRoutedEventArgs e) { int number; if (int.TryParse(Line.Text, out number)) { MainWindow.ScrollToLineCommand.Execute(number, Owner); Close(); } else { Notify.Beep(); } }