コード例 #1
0
        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>());
            }
        }
コード例 #2
0
        public SettingsPageViewModel(
            IAppSettingsUtility appSettingsUtility,
            IMusicImportService musicImportService,
            ILibraryService libraryService)
        {
            _musicImportService = musicImportService;
            _libraryService = libraryService;
            AppSettingsUtility = appSettingsUtility;

            ImportCommand = new DelegateCommand(ImportExecute);
            DeleteCommand = new DelegateCommand(DeleteExecute);
        }
コード例 #3
0
        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");
            }
        }