private void OK_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(FileName)) { System.Windows.MessageBox.Show("Please specify a Model File Name"); FileSelector.Focus(); } else { DialogResult = true; this.Close(); } }