private async Task SaveModel() { try { if (_updatingPage) { // Updates the brand, including the image await _brandRepo.UpdateAsyncWithImage(BrandModel); } else { // Creates the brand, including the image await _brandRepo.AddAsyncWithImage(BrandModel); Visibility = Visibility.Collapsed; } await _brandRepo.SaveChangesAsync(); TriggerSaveEvent(); } catch (Exception) { MessageBox.Show(LangResource.ErrSaveFailedContent, LangResource.ErrSaveFailedTitle); } }