Beispiel #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;
            }
        }
Beispiel #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);
     }
 }