/// <summary> /// Method called by the dismiss button to close the dialog /// sets the task to complete, show to false and renders the component (which hides it as show is false!) /// </summary> public async void Dismiss() { _ = _modalcompletiontask.TrySetResult(ModalResult.Cancel()); this._ShowModal = false; this._Content = null; await InvokeAsync(Render); }
public async Task SubmitAsync() { HttpResponseMessage response = null; try { response = await _client.IdentityClient.PostAsync("admin/create-business-admin", JsonMessage.CreateJsonMessage(new { BusinessId = Id, Email })); } catch (HttpRequestException) { _toastService.ShowError(ServiceError.Standard.Reason); return; } if (response.IsSuccessStatusCode) { _modalService.Close(ModalResult.Cancel()); _toastService.ShowSuccess($"Email sent to user {Email} to confirm their account"); Email = string.Empty; Id = Guid.Empty; return; } else if (response.StatusCode == System.Net.HttpStatusCode.BadRequest) { var error = await ServiceError.Deserialize(response); _toastService.ShowError(error.Reason); } }
private async void CancelModals(object sender, LocationChangedEventArgs e) { foreach (var modalReference in Modals) { modalReference.Dismiss(ModalResult.Cancel()); } Modals.Clear(); await InvokeAsync(StateHasChanged); }
public async Task SubmitAsync() { var res = await _businessService.UpdateContactAsync(new HeadContact { FirstName = FirstName, SecondName = SecondName, Email = Email, ContactNumber = ContactNumber }, BusinessId); if (res) { _modalService.Close(ModalResult.Cancel()); await _pubSubService.Publish <UpdateBusinessProfile>(); } }
public async Task SubmitAsync() { var result = await _businessService.UpdateOfficeAsync(new HeadOffice { PostCode = PostCode, AddressLine1 = AddressLine1, AddressLine2 = AddressLine2 }, BusinessId); if (result) { await _pubSubService.Publish <UpdateBusinessProfile>(); _modalService.Close(ModalResult.Cancel()); } }
public void Close(bool state) { if (state) { this.Parent.Close(ModalResult.Exit()); } else { this.Parent.Close(ModalResult.Cancel()); } }
public void Cancel() { if (IsModal) { this.ModalParent.Close(ModalResult.Cancel()); } else { this.ViewManager.LoadViewAsync(this.ViewManager.LastViewData); } }
public async Task SubmitAsync() { var result = await _businessService.UpdateDetails(Id, Name, TradingName, WebAddress); if (result) { await _pubSubService.Publish <UpdateBusinessProfile>(); _modalService.Close(ModalResult.Cancel()); } }
private async void CancelModals(object sender, LocationChangedEventArgs e) { foreach (var modalReference in Modals.ToList()) { await JSRuntime.InvokeVoidAsync("BlazoredModal.deactivateFocusTrap", modalReference.Id, modalReference.ModalInstanceRef.Options.DisableBodyReposition); modalReference.Dismiss(ModalResult.Cancel()); } Modals.Clear(); await InvokeAsync(StateHasChanged); }
public async Task SubmitAsync() { var res = await _siteService.CreateSiteResource(SiteId, Name, Identifier); if (res) { _modalService.Close(ModalResult.Cancel()); Name = string.Empty; Identifier = string.Empty; SiteId = Guid.Empty; } }
internal async Task CancelInstance(Guid Id) { await DismissInstance(Id, ModalResult.Cancel()); }
void CancelClicked() { BlazoredModal.Close(ModalResult.Cancel()); }
/// <summary> /// Closes the modal and returns a cancelled ModalResult. /// </summary> public async Task Cancel() { await Close(ModalResult.Cancel()); }
internal void CancelInstance(Guid Id) { DismissInstance(Id, ModalResult.Cancel()); }
protected async Task ModalCancel() { await Modal.CloseAsync(ModalResult.Cancel()); }
internal void CancelInstance(Guid Id) { var reference = GetModalReference(Id); CloseInstance(reference, ModalResult.Cancel()); }
public void Close() { Close(ModalResult.Cancel()); }
void Cancel() { Modal.Close(ModalResult.Cancel()); }
void Cancel() { ShowForm = false; ModalService.Close(ModalResult.Cancel()); }
public void Close(object result = null) { lastResult = result; ModalService.Close(ModalResult.Cancel()); }
public void Cancel() { CloseModal?.Invoke(); OnClose?.Invoke(ModalResult.Cancel(this._modalType)); }