示例#1
0
        private async void ImportSong()
        {
            var picker = new FileOpenPicker();

            picker.FileTypeFilter.Add(".mp3");
            picker.SuggestedStartLocation = PickerLocationId.MusicLibrary;

            var files = await picker.PickMultipleFilesAsync();

            foreach (var file in files)
            {
                try
                {
                    Model.FileSong fileSong = await Model.FileSong.Create(file);

                    var song = new SongViewModel(new Common.Song(fileSong), this);
                    this.Songs.Add(song);
                }
                catch (Exception e)
                {
                    App.Log(e);
                }
            }
        }
示例#2
0
 public JumpViewModel(SongViewModel song)
 {
     Song = song;
     OnDeserialized(default(StreamingContext));
 }