Version

ItemAdded Method (SummaryCalculator)

Notifies when an item is added to the data source so the summary result can be updated.
Syntax
public virtual ISummaryResult ItemAdded( 
   object item,
   ISummaryResult previousResult,
   int currentCount
)

Parameters

item
The newly added item.
previousResult
The previous summary result.
currentCount
The current number of items available to the summary.

Return Value

The updated summary result.
Remarks
This allows the data source to update the summary result without having to re-iterate through the data source. If you are using a custom summary and need to re-iterate through all the items in order to calculate an accurate result then you can set the IsSummaryDirty property to let the data source know it needs to do this. Note that it is possible for the previousResult argument to be null. This will happen when an item is added to the data source and a new section is created as a result.
Requirements

Target Platforms: Android 4.4+, iOS 8+

Development Environments: Visual Studio 2015+, Visual Studio for Mac Preview, Xamarin for Visual Studio 4.2+

See Also