private bool AddAirplane(AirplaneModel airplaneModel) { var editWindow = new EditAirplaneWindow(); var ctx = (EditAirplaneViewModel)editWindow.DataContext; ctx.Airplane = airplaneModel; if (editWindow.ShowDialog() != true) { return(false); } var errs = GetModelErrors(ctx.Airplane); if (errs != string.Empty) { ShowError(errs, "Error! Saving cancelled. "); return(false); } _airplaneService.AddAirplane(airplaneModel); return(true); }