示例#1
0
 public DirectYoutubeViewModel(Library library, CoreSettings coreSettings, Guid accessToken, IYoutubeSongFinder youtubeSongFinder = null)
     : base(library, coreSettings, accessToken)
 {
     this.youtubeSongFinder = youtubeSongFinder ?? new YoutubeSongFinder(Locator.Current.GetService <IBlobCache>(BlobCacheKeys.RequestCacheContract));
 }
示例#2
0
        public YoutubeViewModel(Library library, ViewSettings viewSettings, CoreSettings coreSettings, Guid accessToken, IYoutubeSongFinder songFinder = null)
            : base(library, accessToken, coreSettings,
                   song => new YoutubeSongViewModel(song, () => coreSettings.YoutubeDownloadPath),
                   songFinder ?? new YoutubeSongFinder(Locator.Current.GetService <IBlobCache>(BlobCacheKeys.RequestCacheContract)))
        {
            if (viewSettings == null)
            {
                throw new ArgumentNullException(nameof(viewSettings));
            }

            this.viewSettings = viewSettings;

            this.OrderByRatingCommand = ReactiveCommand.Create();
            this.OrderByRatingCommand.Subscribe(_ => this.ApplyOrder(SortHelpers.GetOrderByRating, ref this.ratingOrder));

            this.OrderByViewsCommand = ReactiveCommand.Create();
            this.OrderByViewsCommand.Subscribe(_ => this.ApplyOrder(SortHelpers.GetOrderByViews, ref this.viewsOrder));
        }