I would like to know exactly how to dynamically use a Dictionary Resource in the C# code behind - ie.. I would like to load images at runtime from an image resource within a dic
This is an addition to the accepted answer:
When working within a ViewModel
from MVVM, make sure to use the FindResource
from the view where the resource directory is added.
My view in this case is a window (I know not correct MVVM ;-) )
Image img = new Image();
img.Source = (ImageSource)WindowReference.FindResource("Pluse");
Here the WindowReference
is a reference to My.MainWindow
.