Exemple #1
0
        private void SetupFeedList()
        {
            DataConnection.getFeeds().CollectionChanged += feedsChanged;
            DataConnection.getCategories().CollectionChanged += categoriesChanged;

            Feeds = new ObservableCollection<FeedViewModel>();
            foreach (Feed feed in DataConnection.getFeeds().GetAll())
            {
                var feedViewModel = new FeedViewModel(feed);
                //feedViewModel.PropertyChanged += updateRepository;
                Feeds.Add(feedViewModel);
            }
            Feeds.CollectionChanged += updateRepository;
            FeedsViewSource = new CollectionViewSource();
            FeedsViewSource.Source = Feeds;
        }
Exemple #2
0
 private void feedsChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Add)
     {
         var feedView = new FeedViewModel((e.NewItems[0] as Feed));
         //feedView.PropertyChanged += updateRepository;
         Feeds.Add(feedView);
     }
 }