Example #1
0
        private void SetModalOptions(ModalOptions options)
        {
            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;
            }
        }
Example #2
0
        public void ShowModal(string title, RenderFragment content, ModalParameters parameters, ModalOptions options)
        {
            Title      = title;
            Content    = content;
            Parameters = parameters;

            SetModalOptions(options);

            IsVisible = true;
            StateHasChanged();
        }