simone.tino
simone.tino

Reputation: 2464

Windows Phone 8.1 LongListSelector does not automatically update on data refresh

I have a simple LongListSelector displaying some data. When I modify a record, the LongListSelector does not display the changes. I want that, when a record changes, the LongListSelector automatically displays the changes. How can I do that? Is there a way to force my LongListSelector to display updated data?

EDIT:

Data are stored in an ObservableCollection and added to the LongListSelector using DataContext.

Upvotes: 0

Views: 846

Answers (1)

simone.tino
simone.tino

Reputation: 2464

Following this guide, I understand MVVM Pattern and solve my problem. In my case, my Model did not implement INotifyPropertyChanged, so the Model did not notify the View about changes. In order to sync View and Model:

  • Model must implement INotifyPropertyChanged, so that PropertyChangedEventArgs() event can be raised when some properties has changed.
  • The collection (data) must be an ObservableCollection.
  • Finally, use binding to sync Model and View.

Upvotes: 1

Related Questions