Beispiel #1
0
 private async void PlayAllCloudMusicCommandExecute()
 {
     if (CloudMusics.Count > 0)
     {
         await this._playPart.MusicsListCollection.AddRangeAsync(CloudMusics.Select(x => new Music
         {
             Id       = x.Id,
             Name     = x.Name,
             Duration = x.SimpleMusic?.Duration ?? TimeSpan.Zero,
         }), async x => await this._playPart.Play(x[0]));
     }
 }
Beispiel #2
0
        public override async void OnNavigatedTo(NavigationContext navigationContext)
        {
            if (!this._dataIsInit)
            {
                //var json = await this._netWorkServices.GetAsync("User", "UserCloud", new { limit = 200, offset = 0 });
                //this._innerModel = JsonConvert.DeserializeAnonymousType(json, this._innerModel);
                var networkResult = await this._netWorkServices.GetAnonymousTypeAsync("User", "UserCloud", new { limit = 200, offset = 0 }, this._innerModel);

                if (networkResult.Successed)
                {
                    this._innerModel = networkResult.Data;
                    await CloudMusics.AddRangeAsync(this._innerModel.CloudMusics);

                    RaisePropertyChanged(nameof(Size));
                    RaisePropertyChanged(nameof(MaxSize));
                    this._dataIsInit = true;
                }
                else
                {
                    //显示网络连接失败的提示信息
                }
            }
            base.OnNavigatedTo(navigationContext);
        }