Exemplo n.º 1
0
        public async Task WatchMatchMedia()
        {
            if (string.IsNullOrEmpty(Breakpoint))
            {
                return;
            }

            bool matchBelow = await JsInvokeAsync <bool>(JSInteropConstants.matchMedia, $"(max-width: {_dimensionMap[Breakpoint]})");

            this.Below     = matchBelow;
            this.Collapsed = matchBelow;
            await this.OnCollapse.InvokeAsync(matchBelow);

            OnCollapsed?.Invoke(this.Collapsed);
            await OnBreakpoint.InvokeAsync(matchBelow);
        }
Exemplo n.º 2
0
        private void OptimizeSize(decimal windowWidth)
        {
            BreakpointType actualBreakpoint = _breakpoints[_breakpoints.Length - 1];

            for (int i = 0; i < _breakpoints.Length; i++)
            {
                if (windowWidth <= _breakpoints[i].Width && (windowWidth >= (i > 0 ? _breakpoints[i - 1].Width : 0)))
                {
                    actualBreakpoint = _breakpoints[i];
                }
            }

            SetGutterStyle(actualBreakpoint.Name);

            if (OnBreakpoint.HasDelegate)
            {
                OnBreakpoint.InvokeAsync(actualBreakpoint);
            }

            StateHasChanged();
        }
Exemplo n.º 3
0
        private void OptimizeSize(decimal windowWidth)
        {
            BreakpointType actualBreakpoint = _breakpoints[_breakpoints.Length - 1];

            for (int i = 0; i < _breakpoints.Length; i++)
            {
                if (windowWidth <= (int)_breakpoints[i] && (windowWidth >= (i > 0 ? (int)_breakpoints[i - 1] : 0)))
                {
                    actualBreakpoint = _breakpoints[i];
                }
            }

            this._currentBreakPoint = actualBreakpoint;

            SetGutterStyle(actualBreakpoint);

            if (OnBreakpoint.HasDelegate)
            {
                OnBreakpoint.InvokeAsync(actualBreakpoint);
            }

            StateHasChanged();
        }