Example #1
0
        /// <summary>
        /// Helpers
        /// </summary>
        /// <param name="files"></param>
        private void DisplayFiles(StorageFile[] files)
        {
            if (files != null)
            {
                ObservableCollection<Song> newList = new ObservableCollection<Song>();
                foreach (var item in files)
                {
                    Song newSong = new Song(item.Name, item.Path);
                    newList.Add(newSong);
                }

                if (this.Songs != null)
                {
                    foreach (var item in this.Songs)
                    {
                        newList.Add(item);
                    }
                }
                this.Songs = newList;
            }
        }
Example #2
0
 private void PerformGoRight()
 {
     if (currentSong.Path != null)
     {
         int currentSongIndex = this.Songs.IndexOf(currentSong);
         if (currentSongIndex < this.Songs.Count - 1)
         {
             currentSong = this.Songs.ElementAt(currentSongIndex + 1);
         }
         else
         {
             currentSong = this.Songs.ElementAt(0);
         }
         if (this.MyMediaElement.CurrentState == MediaElementState.Playing)
         {
             Play_Media_Element();
         }
         this.MyListBox.SelectedItem = currentSong;
     }
 }