private void CloseDialog() { if (City != null && !City.HasErrors) { _cityEndpoint.PostCity(City); var result = ButtonResult.OK; var p = new DialogParameters(); p.Add("city", City); RequestClose?.Invoke(new DialogResult(result, p)); } }
private void SaveCityToDatabase() { var parameters = new DialogParameters(); parameters.Add("city", SelectedCity); _showDialog.ShowDialog(nameof(CityEdit), parameters, result => { if (result.Result == ButtonResult.OK) { CityModel city = result.Parameters.GetValue <CityModel>("city"); _cityEndpoint.PostCity(city); LoadCities(); } }); }