private async Task ShowInternalAsync(CurrencyName dialog, string errorMessage) { dialog.ErrorMessage = errorMessage; ContentDialogResult result = await dialog.ShowAsync(); if ((result == ContentDialogResult.Primary || dialog.IsEnterPressed) && !String.IsNullOrEmpty(dialog.UniqueCode)) { await commandDispatcher.HandleAsync(new CreateCurrency(dialog.UniqueCode, dialog.Symbol)); } }
private async Task ShowInternalAsync(CurrencyName dialog, string errorMessage) { dialog.ErrorMessage = errorMessage; ContentDialogResult result = await dialog.ShowAsync(); if ((result == ContentDialogResult.Primary || dialog.IsEnterPressed) && !String.IsNullOrEmpty(dialog.UniqueCode)) { try { // TODO: Not working after rewrite to commands. await commandDispatcher.HandleAsync(new CreateCurrency(dialog.UniqueCode, dialog.Symbol)); } catch (CurrencyAlreadyExistsException) { await ShowInternalAsync(dialog, messageBuilder.CurrencyAlreadyExists(dialog.UniqueCode)); } } }