Exemple #1
0
 public async Task SetRemoteImage(RemoteImage image, CancellationToken token)
 {
     if (image == null)
     {
         throw new ArgumentNullException();
     }
     if (this._image == image)
     {
         return;
     }
     this._image = image;
     if (!this._image.IsLoaded)
     {
         try
         {
             _platform.SetImage(_placeholder);
             _platform.OnLoadingStarted();
             await image.Load(token);
         }
         catch (Exception e)
         {
             _platform.SetImage(_placeholder);
             if (e is OperationCanceledException)
             {
                 return;
             }
             throw;
         }
         finally
         {
             _platform.OnLoadingFinished();
         }
     }
     if (image.Bitmap.Native == null)
     {
         _platform.SetImage(_placeholder);
     }
     else
     {
         _platform.SetImage(image.Bitmap);
     }
 }
Exemple #2
0
 public async Task SetRemoteImage(RemoteImage image, CancellationToken token)
 {
     await _model.SetRemoteImage(image, token);
 }