Example #1
0
        public void Toggle()
        {
            IsOpen = !IsOpen;
            Toggled?.Invoke(IsOpen);

            BarItem?.MenuChanged();

            StateHasChanged();
        }
Example #2
0
        public void Close()
        {
            var temp = IsOpen;

            IsOpen = false;

            if (temp != IsOpen)   // used to prevent toggle event call if Close() is called multiple times
            {
                Toggled?.Invoke(IsOpen);
            }

            BarItem?.MenuChanged();

            StateHasChanged();
        }