My WPF application includes a resource file MyResources.resx, containing several strings and images. Because the application will need to be localized, all my references to
Turn your x:Static
into a Binding.Source
and add a Converter which does Bitmap to ImageSource.
Source="{Binding Source={x:Static local:Properties.MyResources.Flag},
Converter={StaticResource BitmapToImageSourceConverter}}"
Alternatively you can make the converter a custom markup extension which takes a Bitmap
and returns the ImageSource
in ProvideValue.
Source="{me:BitmapToImageSource {x:Static local:Properties.MyResources.Flag}}"