Add supported for key mediator handelrs

This commit is contained in:
TheXamlGuy
2024-06-02 15:00:59 +01:00
parent c24538f545
commit 48b33416c9
7 changed files with 104 additions and 39 deletions
+15 -8
View File
@@ -199,12 +199,22 @@ public partial class ObservableCollection<TItem> :
Clear();
}
AggregateExpression expression = CreateAggregateExpression();
AggregateExpression expression = BuildAggregateExpression();
Publisher.PublishUI(expression.Value, expression.Key);
}
public void Fetch(Func<AggregateExpression> aggregateDelegate,
bool reset = false)
{
if (reset)
{
Clear();
}
AggregateExpression expression = aggregateDelegate.Invoke();
Publisher.PublishUI(expression.Value, expression.Key);
}
protected virtual IAggregate OnAggerate() =>
new AggerateEventArgs<TItem>();
public void Clear()
{
@@ -565,11 +575,8 @@ public partial class ObservableCollection<TItem> :
collection.Insert(index > Count ? Count : index, item);
}
protected virtual AggregateExpression CreateAggregateExpression() =>
new AggregateExpression(new AggerateEventArgs<TItem>());
protected virtual object? CreateAggregationKey() =>
default;
protected virtual AggregateExpression BuildAggregateExpression() =>
new(new AggerateEventArgs<TItem>());
protected virtual void RemoveItem(int index) =>
collection.RemoveAt(index);