예제 #1
0
        private void SetModalOptions(ModalOptions options)
        {
            ComponentHideHeader = HideHeader;
            if (options.HideHeader.HasValue)
            {
                ComponentHideHeader = options.HideHeader.Value;
            }

            ComponentHideCloseButton = HideCloseButton;
            if (options.HideCloseButton.HasValue)
            {
                ComponentHideCloseButton = options.HideCloseButton.Value;
            }

            ComponentDisableBackgroundCancel = DisableBackgroundCancel;
            if (options.DisableBackgroundCancel.HasValue)
            {
                ComponentDisableBackgroundCancel = options.DisableBackgroundCancel.Value;
            }

            ComponentPosition = string.IsNullOrWhiteSpace(options.Position) ? Position : options.Position;
            if (string.IsNullOrWhiteSpace(ComponentPosition))
            {
                ComponentPosition = _defaultPosition;
            }

            ComponentStyle = string.IsNullOrWhiteSpace(options.Style) ? Style : options.Style;
            if (string.IsNullOrWhiteSpace(ComponentStyle))
            {
                ComponentStyle = _defaultStyle;
            }
        }
예제 #2
0
        private async void ShowModal(string title, RenderFragment content, ModalParameters parameters, ModalOptions options)
        {
            Title      = title;
            Content    = content;
            Parameters = parameters;

            SetModalOptions(options);

            IsVisible = true;

            await JSRuntime.InvokeVoidAsync("blazoredModal.registerEscListener", DotNetObjectReference.Create(this));

            await InvokeAsync(StateHasChanged);
        }
예제 #3
0
        private void ShowModal(string title, RenderFragment content, ModalParameters parameters, ModalOptions options)
        {
            Title      = title;
            Content    = content;
            Parameters = parameters;

            SetModalOptions(options);

            IsVisible = true;
            StateHasChanged();
        }