I have some images added to Properties.Resources, where I can access them like:
Properties.Resources.LayerIcon;
and want to use it in Xaml, but don’t know how to do this.
I know there are different ways for images to be added into a WPF project, but I need to use Properties.Resources, because that’s the only way I found where the images show up, when the application is launched via reflection.
The images in
Properties.Resourcesare of typeSystem.Drawing.Bitmap, but WPF usesSystem.Windows.Media.ImageSource. You can create a converter:And use it as follows:
Make sure your Resource is set to public and not internal.