예제 #1
0
        private void NewSong_Click(object sender)
        {
            IsInEditMode = true;

            Songs.Add(new SongData("Title", "Author")
            {
                Lyric = new List <SongLyric>()
                {
                    new SongLyric()
                    {
                        Text = "Verse 1"
                    }
                }
            });

            SongData lastSong = Songs[Songs.Count - 1];

            SongData = lastSong;

            SongLyrics.Clear();

            foreach (SongLyric lyric in lastSong.Lyric)
            {
                SongLyrics.Add(lyric);
            }
        }
예제 #2
0
        private void DiscardSong_Click(object sender)
        {
            IsInEditMode = false;

            SongData selectedItem = Songs[Songs.Count - 1];

            SongData = selectedItem;
            SongLyrics.Clear();
            Songs.Remove(selectedItem);
            SongData = null;
        }
예제 #3
0
        private void DeleteSong_Click(object sender)
        {
            SongData selectedItem = SongData;

            if (selectedItem != null)
            {
                selectedItem.Delete();
                SongLyrics.Clear();
                Songs.Remove(selectedItem);
                SongData = null;
            }
        }
예제 #4
0
        private void DiscardEdit_Click(object sender)
        {
            IsInEditMode = false;

            SongData selectedItem = SongData;

            selectedItem.Delete();

            SongData = prevSong;
            SongLyrics.Clear();

            foreach (SongLyric lyric in prevSong.Lyric)
            {
                SongLyrics.Add(lyric);
            }
            prevSong.Save();
        }
예제 #5
0
        private void Add_Lyric(object sender)
        {
            SongData selectedItem = SongData;

            selectedItem.Lyric.Add(
                new SongLyric()
            {
                Text = "New Lyric"
            });

            SongLyrics.Clear();

            foreach (SongLyric lyric in selectedItem.Lyric)
            {
                SongLyrics.Add(lyric);
            }
        }