示例#1
0
        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();
        }
示例#2
0
        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;
        }
示例#3
0
        async Task DeleteSong(Song song)
        {
            await InternetSongService.DeleteSong(song.Id);

            await Refresh();
        }