0

I'm new to Windows Phone 8 development. I've been working with it for about a month now and have written my own news app consuming data from an API. I save article content offline into the app's local storage as .json files. Since I have already them saved offline I want to give my users the ability to 'save' that article to a list of favourites and have one of my pivot items show the list of saved articles for them to access later. I also want that list manageable by the user i.e. I want them to be able to delete the items as necessary.

I'm planning on loading the data context for the list using an object called:

SavedArticles

which is simply a

List<Article>

I've read a lot about how to update the current view using INotifyPropertyChanged, but I think that is more about updating properties of existing items in the list. What I need is something that can update the ItemsSource after the user selects an item and then clicks delete in the AppBar. I think that is where INotifyCollectionChanged should come in, but for the life of me, I can't see how to implement it.

Looking for someone to enlighten me or point me at a great example.

I have Googled this to death but cannot find many examples and the ones I have seen, I'm just not getting.

Thanks!

4

1 に答える 1

0

(from ) をList<Article>使用する代わりに、これは を実装します。 これは、基礎となるコレクションから項目を削除すると (削除関数が行うべきことです)、これがデータバインドされた UI コレクションに反映されることを意味します。ObservableCollection<Article>System.Collections.ObjectModelINotifyCollectionChanged

于 2013-10-02T08:39:16.133 に答える