private DialogOptions BuildDialogOptions() { DialogOptions options = new DialogOptions() { OnClosed = AfterClose, BodyStyle = BodyStyle, CancelText = CancelText, Centered = Centered, Closable = Closable, Draggable = Draggable, DragInViewport = DragInViewport, CloseIcon = CloseIcon, ConfirmLoading = ConfirmLoading, DestroyOnClose = DestroyOnClose, Footer = Footer, ForceRender = ForceRender, GetContainer = GetContainer, Keyboard = Keyboard, Mask = Mask, MaskClosable = MaskClosable, MaskStyle = MaskStyle, OkText = OkText, OkType = OkType, Title = Title, Width = Width, WrapClassName = WrapClassName, ZIndex = ZIndex, OnCancel = async(e) => { if (OnCancel.HasDelegate) { await OnCancel.InvokeAsync(e); } }, OnOk = async(e) => { if (OnOk.HasDelegate) { await OnOk.InvokeAsync(e); } }, OkButtonProps = OkButtonProps, CancelButtonProps = CancelButtonProps, Rtl = Rtl }; return(options); }
#pragma warning restore 649 private DialogOptions BuildDialogOptions() { DialogOptions options = new DialogOptions() { OnClosed = AfterClose, BodyStyle = BodyStyle, CancelText = CancelText ?? Locale.CancelText, Centered = Centered, Closable = Closable, Draggable = Draggable, DragInViewport = DragInViewport, CloseIcon = CloseIcon, ConfirmLoading = ConfirmLoading, Footer = Footer, GetContainer = GetContainer, Keyboard = Keyboard, Mask = Mask, MaskClosable = MaskClosable, MaskStyle = MaskStyle, OkText = OkText ?? Locale.OkText, OkType = OkType, Title = Title, TitleTemplate = TitleTemplate, Width = Width, WrapClassName = WrapClassName, ZIndex = ZIndex, OnCancel = async(e) => { var args = new ModalClosingEventArgs(e, false); var modalTemplate = (ModalRef as IFeedbackRef)?.ModalTemplate; if (modalTemplate != null) { await modalTemplate.OnFeedbackCancelAsync(args); } if (!args.Cancel) { await(ModalRef?.OnCancel?.Invoke() ?? Task.CompletedTask); if (OnCancel.HasDelegate) { await OnCancel.InvokeAsync(e); } } }, OnOk = async(e) => { var args = new ModalClosingEventArgs(e, false); var modalTemplate = (ModalRef as IFeedbackRef)?.ModalTemplate; if (modalTemplate != null) { await modalTemplate.OnFeedbackOkAsync(args); } if (!args.Cancel) { await(ModalRef?.OnOk?.Invoke() ?? Task.CompletedTask); if (OnOk.HasDelegate) { await OnOk.InvokeAsync(e); } } else { ConfirmLoading = false; await InvokeStateHasChangedAsync(); } }, OkButtonProps = OkButtonProps, CancelButtonProps = CancelButtonProps, Rtl = Rtl, MaxBodyHeight = MaxBodyHeight }; return(options); }
protected void HandleOk(MouseEventArgs e) { Console.WriteLine(e); OnOk.InvokeAsync(SelectedIcon); _visible = false; }