예제 #1
0
 public NewsDetailsPageViewModel(ISessionStateService sessionStateService,
                                 INavigationService navigationService,
                                 FeedNewsProvider feedNewsProvider)
 {
     _navigationService   = navigationService;
     _sessionStateService = sessionStateService;
     _feedNewsProvider    = feedNewsProvider;
     ViewInWebCommand     = new DelegateCommand(ViewInWebExecute);
     ViewCommentsCommand  = new DelegateCommand(ViewCommentsExecute);
 }
        public NewsListViewModel(FeedNewsProvider feedNewsProvider)
        {
            _feedNewsProvider = feedNewsProvider;
            RefreshCommand    = new DelegateCommand(RefreshExecute);

            var categories = GeneratesCategories();

            NewsViewModels    = new ObservableCollection <NewsViewModel>(categories.Select(x => new NewsViewModel(_feedNewsProvider, x)));
            SelectedViewModel = NewsViewModels[0];
        }
예제 #3
0
 public FictionListViewModel(FeedNewsProvider feedNewsProvider)
 {
     _feedNewsProvider  = feedNewsProvider;
     FictionsViewModels = new ObservableRangeCollection <FictionViewModel>();
 }
예제 #4
0
 public NewsViewModel(FeedNewsProvider feedNewsProvider, Category category)
 {
     _feedNewsProvider = feedNewsProvider;
     Category          = category;
     FeedItems         = new IncrementalObservableCollection <NewsItem>(LoadMoreItemsAsync);
 }