public CategoryListViewModel(IThemeService themeService, IRssReader rssReader, IAsyncDownloadManager downloadManager, INavigationService navigationService, ILockscreenHelper lockscreen, IDownloadHelper downloadHelper) { _themeService = themeService; _rssReader = rssReader; _downloadManager = downloadManager; _navigationService = navigationService; _lockscreen = lockscreen; _downloadHelper = downloadHelper; AddMorePicturesCommand = Items.CountChanged .Select(_ => Items.Count < imageMetaData.Count()) .ToCommand(); AddMorePicturesCommand .RegisterAsyncTask(value => GetImages((int)value)); FullScreenCommand = new ReactiveCommand(); SetLockScreenCommand = new ReactiveCommand(); SetLockScreenCommand .RegisterAsyncTask(value => SetLockscreen(value as CategoryItem)); DownloadImageCommand = new ReactiveCommand(); DownloadImageCommand .RegisterAsyncTask(value => DownloadImage(value as CategoryItem)); }
public MainPageViewModel(IThemeService themeService, IRssReader rssReader, IAsyncDownloadManager downloadManager, INavigationService navigationService, ILockscreenHelper lockscreenHelper, INotificationService notificationService) { _themeService = themeService; _rssReader = rssReader; _downloadManager = downloadManager; _navigationService = navigationService; _lockscreenHelper = lockscreenHelper; this._notificationService = notificationService; this.ObservableForProperty(vm => vm.SelectedCategory).Select(_ => _.GetValue()).Subscribe(NavigateToCategoryList); this.ObservableForProperty(vm => vm.SelectedTop4).Select(_ => _.GetValue()).Where(v => v != null).Subscribe(Top4Selected); }