Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

ImageSource.FromStream fails on Windows Phone with Invalid cross-thread access exception

$
0
0

I have an image that is data-bound to ImageSource object. It works on Android but fails on Windows Phone platform. I've tried multiple ways to initialize ImageSource:

  • ImageSource.FromStream(()=>GetMyMemoryStream());
  • ImageSource.FromResource(resourceUri.ToString());

but all of them fail with cross-thread access. It appears that internally Xamarin.Forms.ImageSource is using a Task and when the task runs it uses non-UI thread.

Any workarounds?

Thanks!


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>