Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6797073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:33:49+00:00 2026-05-26T18:33:49+00:00

My WPF application includes a resource file MyResources.resx, containing several strings and images. Because

  • 0

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 globalized resources must be made via named properties of the auto-generated MyResources class. The following code works well for string resources:

<Button Content="{x:Static local:Properties.MyResources.ButtonText}" />

However the same does not work for images. Assuming I have an image eflag.bmp added to the resources as a resource named Flag, I would like to be able to do something like this:

<Image Source="{x:Static local:Properties.MyResources.Flag}" />

Please note that the following alternative approach:

<Image Source="/MyNamespace;component/Resources/eflag.bmp" />

cannot be used in this case because it will not be able to handle localization. The problem can be solved using code behind but I am looking for a XAML based solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:33:50+00:00Added an answer on May 26, 2026 at 6:33 pm

    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}}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been doing localization for my WPF application by storing strings in .resx files.
I have a fairly small solution that includes a WPF windows application. It builds
My WPF application is structured using the MVVM pattern. The ViewModels will communicate asynchronously
I'm benchmarking a WPF application on various platforms and I need an easy way
I'm playing with a simple WPF application. One part of it includes a grid
All, We are using ClickOnce to deploy our WPF application and have the need
My application is built in WPF but it includes some WinForms components that we
I'm planning a WPF application which will be able to create dynamic data entry
I am currently developing an application in C# using WPF. What I need to
In my WPF C# application, I have included an executable file (.EXE) into the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.