1234567891011121314151617181920212223242526272829303132333435 |
- using InABox.Core;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- namespace InABox.DynamicGrid;
- public interface IDynamicGridColumnFilter
- {
- event Action<IDynamicGridColumnFilter>? FilterChanged;
- FrameworkElement CreateControl();
- bool FilterRow(CoreRow row);
- void ClearFilter();
- bool IsFiltered();
- IEnumerable<CoreRow> GetRowsToFilter(IBaseDynamicGrid grid)
- {
- IEnumerable<CoreRow> rows = grid.Data.Rows;
- foreach(var column in grid.ColumnList)
- {
- if(grid.GetColumnFilter(column) is IDynamicGridColumnFilter filter && filter != this)
- {
- rows = rows.Where(filter.FilterRow);
- }
- }
- return rows;
- }
- }
|