private void AddHU_Click(object sender, RoutedEventArgs e) { try { bl.AddHost(host); MessageBox.Show(host.MsgBoxHost); //host = new BE.Host(); this.AddHostGrid.DataContext = host; } catch (FormatException) { MessageBox.Show("check your input and try again"); } catch (Exception ex) { MessageBox.Show(ex.Message); } this.Close(); }