Ejemplo n.º 1
0
        private void SelectMenuItem()
        {
            if (SettingsClient.Get <bool>("Startup", "ShowLastSelectedPage"))
            {
                SelectedNowPlayingPage page = (SelectedNowPlayingPage)SettingsClient.Get <int>("FullPlayer", "SelectedNowPlayingPage");

                switch (page)
                {
                case SelectedNowPlayingPage.ShowCase:
                    this.IsShowCaseSelected = true;
                    break;

                case SelectedNowPlayingPage.Playlist:
                    this.IsPlaylistSelected = true;
                    break;

                case SelectedNowPlayingPage.Lyrics:
                    this.IsLyricsSelected = true;
                    break;

                case SelectedNowPlayingPage.ArtistInformation:
                    this.IsArtistInformationSelected = true;
                    break;
                }
            }
            else
            {
                this.IsPlaylistSelected = true;
            }
        }
        public NowPlayingScreenViewModel(IRegionManager regionManager, IPlaybackService playbackService)
        {
            this.regionManager   = regionManager;
            this.playbackService = playbackService;

            if (SettingsClient.Get <bool>("Startup", "ShowLastSelectedPage"))
            {
                SelectedNowPlayingPage page = (SelectedNowPlayingPage)SettingsClient.Get <int>("FullPlayer", "SelectedNowPlayingPage");

                switch (page)
                {
                case SelectedNowPlayingPage.ShowCase:
                    this.isShowCaseVisible = true;
                    break;

                case SelectedNowPlayingPage.Playlist:
                    this.isPlaylistVisible = true;
                    break;

                case SelectedNowPlayingPage.Lyrics:
                    this.isLyricsVisible = true;
                    break;

                case SelectedNowPlayingPage.ArtistInformation:
                    this.isArtistInformationVisible = true;
                    break;
                }
            }
            else
            {
                this.isPlaylistVisible = true;
            }

            this.playbackService.PlaybackSuccess += (_) => this.SetNowPlaying();

            this.NowPlayingScreenShowcaseButtonCommand          = new DelegateCommand(() => this.SetShowCase());
            this.NowPlayingScreenPlaylistButtonCommand          = new DelegateCommand(() => this.SetPlaylist());
            this.NowPlayingScreenLyricsButtonCommand            = new DelegateCommand(() => this.SetLyrics());
            this.NowPlayingScreenArtistInformationButtonCommand = new DelegateCommand(() => this.SetArtistInformation());

            this.LoadedCommand = new DelegateCommand(() => this.SetNowPlaying());

            ApplicationCommands.NowPlayingScreenShowcaseButtonCommand.RegisterCommand(this.NowPlayingScreenShowcaseButtonCommand);
            ApplicationCommands.NowPlayingScreenPlaylistButtonCommand.RegisterCommand(this.NowPlayingScreenPlaylistButtonCommand);
            ApplicationCommands.NowPlayingScreenLyricsButtonCommand.RegisterCommand(this.NowPlayingScreenLyricsButtonCommand);
            ApplicationCommands.NowPlayingScreenArtistInformationButtonCommand.RegisterCommand(this.NowPlayingScreenArtistInformationButtonCommand);
        }