Retrieved
This rule is triggered after (re)loading data (GET API call), after the datasource has been populated with the retrieved data.
This occurs when :
- the UI view is opened and its
Load data on startproperty istrue - the user clicks on a
Refreshbutton - calling the load methods (
LoadDataAsync,LoadMoreDataAsync,ReloadDataAsync, ...)
This rule can be used, for example, to set a value on a property which is only defined on the UI view.
See this article for more information on event rules execution order.
Impact on the position in the datasource
When data is retrieved, the position in the datasource can change depending on the state of the datasource prior to (re)loading data.
The new position will be :
-1if no data is retrieved as the datasource is now empty0after the first retrieval if at least one element is retrieved- the
same position as before reloading dataif the position still exists
Arguments
The Arguments property provides the following options.
| Name | Type | Description |
|---|---|---|
Items |
IReadOnlyCollection<T> where T is the UI view model |
Collection of the retrieved items. |
Item versus DatasourceCurrent
This rule is not tied to a particular item so it does not offer an Item property.
DatasourceCurrent refers to the item at the current position which is :
nullwhen the position is-1- the item at the current position when the position is different from
-1.
If this is not the first retrieval and data was already load,DatasourceCurrentrefers to the item at thesame position as before reloading dataif the position still exists
Important
After reloading data, DatasourceCurrent can refer to a different item than the one before reloading. This can occur when the data set returned by the server does not contain the same items as before.
To know more on the difference between the Item and DatasourceCurrent properties in an UI view event rule, you can check this article.