private void OnAddLot_Click(object sender, RoutedEventArgs e) { if (this.YardSelector.SelectedItem == null) { MessageBox.Show("Please first select a yard."); } else { AddLotWindow addYardWindow = new AddLotWindow(); addYardWindow.Owner = this; addYardWindow.ShowDialog(); } }