Ejemplo n.º 1
0
        protected override Task OnParametersSetAsync()
        {
            if (IsRemovable &&
                Direction != SortDirection.Ascending &&
                Direction != SortDirection.Descending)
            {
                Direction = SortDirection.Ascending;

                return(DirectionChanged.InvokeAsync(Direction));
            }

            return(Task.CompletedTask);
        }
Ejemplo n.º 2
0
        public async Task SetNewSortAsync(string sortId, MatSortDirection direction)
        {
            SortId    = sortId;
            Direction = direction;
            await SortIdChanged.InvokeAsync(sortId);

            await DirectionChanged.InvokeAsync(direction);

            await SortChanged.InvokeAsync(new MatSortChangedEvent()
            {
                SortId    = sortId,
                Direction = direction
            });

            this.StateHasChanged();
        }
Ejemplo n.º 3
0
        protected override Task OnToggle()
        {
            if (IsStatic)
            {
                return(Task.CompletedTask);
            }

            Direction = Direction switch
            {
                SortDirection.Ascending => SortDirection.Descending,
                SortDirection.Descending => IsRemovable ? SortDirection.Ascending : SortDirection.None,
                _ => SortDirection.Ascending
            };

            return(DirectionChanged.InvokeAsync(Direction));
        }