protected object Calculate(DataGridAggregate <TItem> aggregate, DataGridColumn <TItem> column) { switch (aggregate.Aggregate) { case DataGridAggregateType.Sum: return(SumOf(column)); case DataGridAggregateType.Average: return(AverageOf(column)); case DataGridAggregateType.Min: return(MinOf(column)); case DataGridAggregateType.Max: return(MaxOf(column)); case DataGridAggregateType.Count: return(CountOf(column)); case DataGridAggregateType.TrueCount: return(TrueCountOf(column)); case DataGridAggregateType.FalseCount: return(FalseCountOf(column)); default: return(null); } }
/// <summary> /// Links the child column with this datagrid. /// </summary> /// <param name="column">Column to link with this datagrid.</param> internal void Hook(DataGridAggregate <TItem> aggregate) { Aggregates.Add(aggregate); }
protected object Calculate(DataGridAggregate <TItem> aggregate, DataGridColumn <TItem> column) => aggregate?.AggregationFunction?.Invoke(Data, column);