I have several images that i want to be Embedded into the exe.
When i set the Build Action to Embedded Resource I get through out t
Just for those using xamarin forms and bump into this question, this can be done by creating a custom xaml markup extension explained here:
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/images?tabs=windows
in the "Embedded Images"->"Using XAML" section
Citation of custom extension
[ContentProperty (nameof(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, typeof(ImageResourceExtension).GetTypeInfo().Assembly);
return imageSource;
}
}
citation of how to use