コード例 #1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            _ = Task.Run((() =>
            {
                Common.Invoke(() =>
                {
                    try
                    {
                        ConnectedAnimation anim = ConnectedAnimationService.GetForCurrentView().GetAnimation("SongListExpand");
                        ConnectedAnimation anim1 = ConnectedAnimationService.GetForCurrentView().GetAnimation("SongListExpandAcrylic");
                        anim1?.TryStart(GridPersonalInformation);
                        anim?.TryStart(RectangleImage);
                    }
                    catch { }
                });
            }));
            await Task.Run((() =>
            {
                Common.Invoke(async() =>
                {
                    if (e.Parameter != null)
                    {
                        if (e.Parameter is NCPlayList)
                        {
                            playList = (NCPlayList)e.Parameter;
                        }
                        else
                        {
                            string pid = e.Parameter.ToString();

                            (bool isok, var json) = await Common.ncapi.RequestAsync(CloudMusicApiProviders.PlaylistDetail,
                                                                                    new Dictionary <string, object>()
                            {
                                { "id", pid }
                            });
                            if (isok)
                            {
                                NCUser user;
                                if (!json["playlist"]["creator"].HasValues)
                                {
                                    user = Common.LoginedUser;
                                }
                                else
                                {
                                    user = new NCUser()
                                    {
                                        avatar = json["playlist"]["creator"]["avatarUrl"].ToString(),
                                        id = json["playlist"]["creator"]["userId"].ToString(),
                                        name = json["playlist"]["creator"]["nickname"].ToString(),
                                        signature = json["playlist"]["creator"]["signature"].ToString()
                                    };
                                }
                                playList = new NCPlayList()
                                {
                                    cover = json["playlist"]["coverImgUrl"].ToString(),
                                    creater = user,
                                    desc = json["playlist"]["description"].ToString(),
                                    name = json["playlist"]["name"].ToString(),
                                    plid = json["playlist"]["id"].ToString()
                                };
                            }
                        }
                    }
                    LoadSongListDetail();
                    LoadSongListItem();
                });
            }));
        }
コード例 #2
0
 public NCMigratingUser(string key, NCUser userData, string rootFolder, Action <string, Exception> log) : base(log)
 {
     Key             = key;
     User            = userData;
     this.rootFolder = rootFolder;
 }