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

Forms Previewer and ImageResourceExtension not loading

$
0
0

Hi, the forms previewer don't show image from my imageresource, is there something I do wrong? It work well on my Android or iOS

my xaml (The normal ContentPage with:)

<Image Source="{local:ImageResource SIV_Lite.back_menu_haut.png}" />

the class:

[ContentProperty("Source")]
public class ImageResourceExtension : IMarkupExtension
{
public string Source { get; set; }

public object ProvideValue(IServiceProvider serviceProvider)
{
    if (Source == null)
    {
        return null;
    }
    // Do your translation lookup here, using whatever method you require
    var imageSource = ImageSource.FromResource(Source);

    return imageSource;
}

}


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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