xamarinxamarin.formscontent-pages

How to refresh ListView in ContentPage in xamarin forms periodically


I have a List-View in the content page, List view Items are picked from the SQLite. I want to refresh the page periodically so that I can able to show the latest items inserted in the sql lite. 1. When the first time I added record status of that record is "queued"in local db, List Item will be displayed and status of that Item will be shown as "[EmployeeNo] it is queued After 5 minutes it will be synced". 2.After 5 minutes,All local db [Sqlite] will be synced with the actual sql server, Then status of that record will be updated to "completed" in local db,Then status I want to show "[EmployeeNo] it is completed" in list view automatically.


Solution

  • Use an ObservableCollection<T> as your ItemSource - it will automatically update the UI whenever items are added or removed from it