Skip to content

Instantly share code, notes, and snippets.

@jonathanpeppers
Created February 15, 2018 17:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanpeppers/e950e923bf944ae4975272280c001b76 to your computer and use it in GitHub Desktop.
Save jonathanpeppers/e950e923bf944ae4975272280c001b76 to your computer and use it in GitHub Desktop.
Magical Xamarin.Forms IImageSourceHandler implementation for Android
using System.Threading;
using System.Threading.Tasks;
using Android.Content;
using Android.Graphics;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportImageSourceHandler(typeof(FileImageSource), typeof(xfperf.FileImageSourceHandler))]
namespace xfperf
{
public class FileImageSourceHandler : IImageSourceHandler
{
public Task<Bitmap> LoadImageAsync(ImageSource imagesource, Context context, CancellationToken cancelationToken = default(CancellationToken))
{
return Task.FromResult<Bitmap>(null);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment