Exemple #1
0
        // ReSharper disable once MemberCanBePrivate.Global
        public async Task HideAsync()
        {
            Shown = false;
            await BlazorStrap.Interop.RemoveDocumentEventAsync(this, DataRefId, EventType.Click);

            if ((Group != null && PopoverRef != null && !IsStatic) || (IsDiv || Parent != null || IsNavPopper))
            {
                if (PopoverRef != null)
                {
                    await PopoverRef.HideAsync();
                }
            }

            if (!string.IsNullOrEmpty(ShownAttribute))
            {
                await BlazorStrap.Interop.RemoveAttributeAsync(MyRef, ShownAttribute);
            }

            await InvokeAsync(StateHasChanged);
        }
Exemple #2
0
        // ReSharper disable once MemberCanBePrivate.Global
        public async Task ShowAsync()
        {
            Shown = true;

            if (!AllowOutsideClick)
            {
                await BlazorStrap.Interop.AddDocumentEventAsync(_objectRef, DataRefId, EventType.Click, AllowItemClick);
            }

            if ((Group != null && PopoverRef != null && !IsStatic) || (IsDiv || Parent != null || IsNavPopper))
            {
                if (PopoverRef != null)
                {
                    await PopoverRef.ShowAsync();
                }
            }

            if (!string.IsNullOrEmpty(ShownAttribute))
            {
                await BlazorStrap.Interop.AddAttributeAsync(MyRef, ShownAttribute, "blazorStrap");
            }

            await InvokeAsync(StateHasChanged);
        }