コード例 #1
0
        private async void ShareToSinaWeibo()
        {
            IsBusy = true;
            try
            {
                var url   = _wallpaperService.GetUrl(Wallpaper.Image, _settings.SelectedWallpaperSize);
                var bytes = await _imageLoader.GetBytesAsync(url);

                var isSuccess = await _bingoShareService.ShareToSinaWeiboAsync(bytes, Wallpaper.Archive.Info + url);

                if (isSuccess)
                {
                    _appToastService.ShowMessage(LocalizedStrings.ShareSuccess);
                }
            }
            catch (UserCancelAuthorizeException)
            {
                _appToastService.ShowInformation(LocalizedStrings.CancelAuthorize);
            }
            catch (Exception ex)
            {
                _appToastService.ShowError(ex.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
コード例 #2
0
 public override void OnSendMessageToWXResponse(SendMessageToWX.Resp response)
 {
     base.OnSendMessageToWXResponse(response);
     if (response.ErrCode == 0)
     {
         _appToastService.ShowMessage(LocalizedStrings.ShareSuccess);
     }
     else
     {
         _appToastService.ShowError(response.ErrStr);
     }
 }
コード例 #3
0
        private async void LoadWallpapersAsync(WallpaperCollection collection)
        {
            if (collection.Count > 0)
            {
                return;
            }

            LoadingCollectionCount++;
            try
            {
                var wallpapers = await _leanCloudWallpaperService.GetWallpapersAsync(collection.Year, collection.Month, _settings.SelectedArea);

                FillWallpaperCollection(collection, wallpapers);
            }
            catch (HttpRequestException ex)
            {
                _appToastService.ShowError(ex.Message);
            }
            finally
            {
                LoadingCollectionCount--;
            }
        }