// Copyright (c) MudBlazor 2021 // MudBlazor licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. namespace Connected.Components; public class FooterContext { internal DataGrid _dataGrid; public IEnumerable Items { get { return _dataGrid.Items; } } public FooterActions Actions { get; internal set; } public bool IsAllSelected { get { if (_dataGrid.Selection != null && Items != null) { return _dataGrid.Selection.Count == Items.Count(); } return false; } } public FooterContext(DataGrid dataGrid) { _dataGrid = dataGrid; Actions = new FooterContext.FooterActions { SetSelectAll = async (x) => await _dataGrid.SetSelectAllAsync(x), }; } public class FooterActions { public Action SetSelectAll { get; internal set; } } }