private void msdEditAddress(object sender, MouseButtonEventArgs e) { //Open form in edit mode if (txtAddress.Text.Count() == 0) { MessageBox.Show("Kindly add an address"); txtStatusMessage.Text += "Kindly add an address"; } else { var editAddress = new subfrmAddAddress(_employee.Address); editAddress.ShowDialog(); } }
/// <summary> /// Subform to editAddress and add new addresses to parent form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddAddress(object sender, RoutedEventArgs e) { var subfrmAddAddress = new subfrmAddAddress(); subfrmAddAddress.ShowDialog(); }