Пример #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 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();
        }
Пример #3
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);
            }
        }