async Task AddSong(Song song) { var name = await Application.Current.MainPage.DisplayPromptAsync("Name", "NameMessage"); var singer = await Application.Current.MainPage.DisplayPromptAsync("Singer", "SingerMessage"); var length = await Application.Current.MainPage.DisplayPromptAsync("Length", "length"); await InternetSongService.AddSong(name, singer, length); await Refresh(); }
async Task Refresh() { //Mode设置为twoWay会自动设置IsBusy=True IsBusy = true; await Task.Delay(1000); song.Clear(); var songs = await InternetSongService.GetSong(); song.AddRange(songs); IsBusy = false; }
async Task DeleteSong(Song song) { await InternetSongService.DeleteSong(song.Id); await Refresh(); }