public ArtistPageViewModel(
            INavigationService navigationService,
            ILibraryService libraryService,
            IEnumerable<IMetadataProvider> metadataProviders,
            IConverter<WebAlbum, Album> webAlbumConverter,
            IConverter<WebArtist, Artist> webArtistConverter,
            IConverter<WebSong, Track> webSongConverter,
            ISettingsUtility settingsUtility)
        {
            _navigationService = navigationService;
            _libraryService = libraryService;
            _webAlbumConverter = webAlbumConverter;
            _metadataProviders = metadataProviders.FilterAndSort<IExtendedMetadataProvider>();

            _webArtistConverter = webArtistConverter;
            _webSongConverter = webSongConverter;
            _settingsUtility = settingsUtility;

            AlbumClickCommand = new DelegateCommand<ItemClickEventArgs>(AlbumClickExecute);
            WebAlbumClickCommand = new DelegateCommand<ItemClickEventArgs>(WebAlbumClickExecute);

            if (IsInDesignMode)
            {
                OnNavigatedTo("Childish Gambino", NavigationMode.New, new Dictionary<string, object>());
            }
        }
        public ExplorePageViewModel(
            INavigationService navigationService,
            IEnumerable<IMetadataProvider> metadataProviders,
            IPlayerService playerService,
            IConverter<WebSong, Track> webToTrackConverter)
        {
            _navigationService = navigationService;
            _playerService = playerService;
            _webToTrackConverter = webToTrackConverter;
            _metadataProviders = metadataProviders.FilterAndSort<IChartMetadataProvider>();

            ArtistClickCommand = new DelegateCommand<ItemClickEventArgs>(ArtistClickExecute);
            AlbumClickCommand = new DelegateCommand<ItemClickEventArgs>(AlbumClickExecute);

            if (IsInDesignMode)
            {
                OnNavigatedTo(null, NavigationMode.New, new Dictionary<string, object>());
            }
        }
Example #3
0
        public AlbumPageViewModel(ILibraryService libraryService, INavigationService navigationService,
            IEnumerable<IMetadataProvider> metadataProviders, IConverter<WebAlbum, Album> webAlbumConverter,
            ISettingsUtility settingsUtility, IPlayerService playerService, ITrackSaveService trackSaveService)
        {
            _libraryService = libraryService;
            _navigationService = navigationService;
            _webAlbumConverter = webAlbumConverter;
            _settingsUtility = settingsUtility;
            _playerService = playerService;
            _trackSaveService = trackSaveService;
            _metadataProviders = metadataProviders.FilterAndSort<IExtendedMetadataProvider>();
            
            ViewInCatalogCommand = new DelegateCommand(ViewInCatalogExecute);
            PlayAllCommand = new DelegateCommand(PlayAllExecute);
            SaveAllCommand = new DelegateCommand<object>(SaveAllExecute);

            if (IsInDesignMode)
                OnNavigatedTo(new AlbumPageParameter("Kauai", "Childish Gambino"), NavigationMode.New,
                    new Dictionary<string, object>());
        }
        public SearchPageViewModel(
            IEnumerable<IMetadataProvider> metadataProviders,
            IConverter<WebSong, Track> webToTrackConverter,
            IConverter<WebAlbum, Album> webToAlbumConverter,
            INavigationService navigationService)
        {
            _webToTrackConverter = webToTrackConverter;
            _webToAlbumConverter = webToAlbumConverter;
            _navigationService = navigationService;
            SearchProviders = metadataProviders.FilterAndSort<ISearchMetadataProvider>();
            SelectedSearchProvider = 0;

            SearchCommand = new DelegateCommand<string>(SearchExecute);
            WebAlbumClickCommand = new DelegateCommand<ItemClickEventArgs>(WebAlbumClickExecute);
            WebArtistClickCommand = new DelegateCommand<ItemClickEventArgs>(WebArtistClickExecute);

            if (IsInDesignMode)
            {
                SearchExecute("childish gambino");
            }
        }