Beispiel #1
0
        /////////////////////////
        //Player Event Handlers//
        /////////////////////////
        private void musicPlayer_Started(AudioFile NewTrack)
        {
            //If the current page is a track page, highlight the row with the playing song
            TrackPage _currentTrackPage = LibraryFrame.Content as TrackPage;

            if (_currentTrackPage != null)
            {
                _currentTrackPage.RefreshDataContext();
            }

            lblTrackName.Content         = $"{NewTrack.Title} - {NewTrack.Artist}";
            playPauseButton.DisplayState = PlayButtonDisplayState.Pause;
            seekBar.StartAnimation(_musicPlayer.GetCurrentTrackLength());
            _trackProgressTimer.Start();
            lblLength.Content = _musicPlayer.GetCurrentTrackLength().ToString(@"mm\:ss");
        }
Beispiel #2
0
        //////////////////
        //User Functions//
        //////////////////
        public void ShowTracksPage(string PageHeader, IEnumerable <AudioFile> Tracks, bool ClearSearch = true, Playlist PlaylistContext = null)
        {
            ClearSidebarSelection();

            TrackPage newPage = new TrackPage(PageHeader, Tracks);

            newPage.PlaylistContext        = PlaylistContext;
            newPage.TracksSelected        += TrackPage_TracksSelected;
            newPage.ArtistSelected        += TrackPage_ArtistSelected;
            newPage.AlbumSelected         += TrackPage_AlbumSelected;
            newPage.AddToPlaylistSelected += TrackPage_AddPlaylistSelected;
            newPage.PlaylistUpdated       += Trackpage_PlaylistUpdated;
            newPage.RefreshDataContext();

            LibraryFrame.Content = newPage;
            if (ClearSearch == true)
            {
                txtSearch.Clear();
            }
        }