Created
February 15, 2018 17:15
-
-
Save jonathanpeppers/e950e923bf944ae4975272280c001b76 to your computer and use it in GitHub Desktop.
Magical Xamarin.Forms IImageSourceHandler implementation for Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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