コード例 #1
0
        private AllSongs CreateReservation()
        {
            var song = App.Model.Songs
                       .Where(i =>
                              i.Artist.ToLower() == ArtistName.Text.ToLower())
                       .FirstOrDefault();

            var songName = App.Model.Songs
                           .Where(i =>
                                  i.Title.ToLower() == SongName.Text.ToLower())
                           .FirstOrDefault();

            if ((song == null) && (songName == null))
            {
                //add a new song if
                //none exist with that name
                song = new AllSongs
                {
                    Artist     = ArtistName.Text,
                    Title      = SongName.Text,
                    SongSource = SongPath.Text,
                };
            }

            return(song);
        }
コード例 #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            SongInfo = e.Parameter as AllSongs;

            if (SongInfo == null)
            {
                ChangeSource();
            }
            else
            {
                OpenMedia();
            }
        }