private void OnSelect(object sender, RoutedEventArgs e) { SelectedShip = lstShips.SelectedIndex; DialogResult = true; this.Close(); }