Beispiel #1
0
        private async void MenuCollect_Click(object sender, RoutedEventArgs e)
        {
            var songId  = 0;
            var context = (sender as MenuFlyoutItem).DataContext;

            if (context is songsListModel)
            {
                songId = (context as songsListModel).id;
            }
            else
            {
                songId = (context as PlayModel).songid;
            }
            if (UserHelper.isLogin || await Utils.ShowLoginDialog())
            {
                try
                {
                    CollectionsDialog cd = new CollectionsDialog(songId);
                    await cd.ShowAsync();
                }
                catch (Exception ex)
                {
                    Utils.ShowMessageToast("收藏歌曲失败");
                    LogHelper.Log("收藏歌曲失败", LogType.ERROR, ex);
                }
            }
            else
            {
                Utils.ShowMessageToast("请先登录");
            }
        }
Beispiel #2
0
 private async void BtnLike_Click(object sender, RoutedEventArgs e)
 {
     if (musicPlay.playInfo.songid != 0)
     {
         CollectionsDialog cd = new CollectionsDialog(musicPlay.playInfo.songid);
         await cd.ShowAsync();
     }
 }
 private async void BtnLike_Click(object sender, RoutedEventArgs e)
 {
     if (UserHelper.isLogin || await Utils.ShowLoginDialog())
     {
         var data             = (sender as Button).DataContext as songsListModel;
         CollectionsDialog cd = new CollectionsDialog(data.id);
         await cd.ShowAsync();
     }
     else
     {
         Utils.ShowMessageToast("请先登录");
     }
 }
 private async void BtnCollect_Click(object sender, RoutedEventArgs e)
 {
     if (UserHelper.isLogin || await Utils.ShowLoginDialog())
     {
         try
         {
             CollectionsDialog cd = new CollectionsDialog(songId);
             await cd.ShowAsync();
         }
         catch (Exception ex)
         {
             Utils.ShowMessageToast("收藏歌曲失败");
             LogHelper.Log("收藏歌曲失败", LogType.ERROR, ex);
         }
     }
     else
     {
         Utils.ShowMessageToast("请先登录");
     }
 }
 private async void BtnSelectLike_Click(object sender, RoutedEventArgs e)
 {
     if (listSongsList.SelectedItems.Count == 0)
     {
         Utils.ShowMessageToast("没有选择任何项");
         return;
     }
     if (UserHelper.isLogin || await Utils.ShowLoginDialog())
     {
         List <int> songids = new List <int>();
         foreach (songsListModel item in listSongsList.SelectedItems)
         {
             songids.Add(item.id);
         }
         CollectionsDialog cd = new CollectionsDialog(songids);
         await cd.ShowAsync();
     }
     else
     {
         Utils.ShowMessageToast("请先登录");
     }
 }