My PCL assembly (named "Foo.Bar") contains a folder "Images" which contains an image file "check_yellow_24.png" (build action = EmbeddedResource). I'm trying to set this image as the source of an Image
control. The image control doesn't display the image, ostensibly because the resource is not found at run time. This is how I'm setting the image source:
imgSelected.Source = ImageSource.FromResource("Foo.Bar.Images.check_yellow_24.png");
I've read the document Working with Images and confirmed the image isn't found at run time by viewing the output of the following diagnostic code fragment. The only discovered embedded resources are the assembly's .xaml
files.
// Display names of embedded resources
var assembly = typeof(SomeClassDefinedInTheAssembly).GetTypeInfo().Assembly;
foreach (var res in assembly.GetManifestResourceNames()) {
System.Diagnostics.Debug.WriteLine(">>> " + res);
}
What do I need to do to successfully retrieve the embedded image resource for use by the containing assembly?