Exemple #1
0
        public void Toggle()
        {
            Visible = !Visible;
            Toggled.InvokeAsync(Visible);

            StateHasChanged();
        }
        public void Toggle()
        {
            IsOpen = !IsOpen;
            Toggled.InvokeAsync(IsOpen);

            StateHasChanged();
        }
Exemple #3
0
        public void Hide()
        {
            // used to prevent toggle event call if Close() is called multiple times
            if (!Visible)
            {
                return;
            }

            Visible = false;
            Toggled.InvokeAsync(Visible);

            StateHasChanged();
        }
Exemple #4
0
        public void Show()
        {
            // used to prevent toggle event call if Open() is called multiple times
            if (Visible)
            {
                return;
            }

            Visible = true;
            Toggled.InvokeAsync(Visible);

            StateHasChanged();
        }
        protected async Task ClickHandler()
        {
            await Click.InvokeAsync(null);

            if (Collapsable)
            {
                Visible = !Visible;

                await InvokeAsync(StateHasChanged);

                await Toggled.InvokeAsync(Visible);
            }
        }
        public void Close()
        {
            // used to prevent toggle event call if Close() is called multiple times
            if (!IsOpen)
            {
                return;
            }

            IsOpen = false;
            Toggled.InvokeAsync(IsOpen);

            StateHasChanged();
        }
        public void Open()
        {
            // used to prevent toggle event call if Open() is called multiple times
            if (IsOpen)
            {
                return;
            }

            IsOpen = true;
            Toggled.InvokeAsync(IsOpen);

            StateHasChanged();
        }
Exemple #8
0
        /// <summary>
        /// Handles all the events in this <see cref="Dropdown"/> based on the visibility flag.
        /// </summary>
        /// <param name="visible">Dropdown menu visibility flag.</param>
        private void HandleVisibilityEvents(bool visible)
        {
            VisibleChanged?.Invoke(this, visible);

            Toggled.InvokeAsync(visible);
        }