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 8052847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:39:58+00:00 2026-06-05T07:39:58+00:00

I have a WPF application which needs to support localization. I have 2 buttons

  • 0

I have a WPF application which needs to support localization. I have 2 buttons (add, delete) and a combo box (english, french). When I select french, button’s content should change to (ajouter, effacer).

Now, my question is, what would be the downside or drawback if I manually set the buttons content in code behind? See code below.

private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
  ResourceDictionary currentLanguage = new ResourceDictionary();

  switch (comboBox.Text)
  {
    case "english": 
      currentLanguage.Source = new Uri("../en-US.xaml", UriKind.RelativeOrAbsolute);
      break;
    case "france": 
      currentLanguage.Source = new Uri("../fr-FR.xaml", UriKind.RelativeOrAbsolute);
      break;
  }

  btnAdd.Content = Resources.GetString("insert");
  btnDelete.Content = Resources.GetString("delete");
}

I know its kind of weird but kindly answer it. Why shouldn’t I localize my application this way.

Thanks!

  • 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-06-05T07:40:00+00:00Added an answer on June 5, 2026 at 7:40 am

    When swapping resource dictionaries you should utilize using DynamicResources instead of StaticResources Basically in XAML you would do the following:

    XAML

      <Button Content="{DynamicResource Insert}"/>
      <Button Content="{DynamicResource Delete}"/>
    

    Where Insert and Delete are in your Resource Dictionaries using the x:Key

    When you swap the dictionary then these will dynamically update

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF application targetting the .NET 4.0 Client Profile which needs to
In a WPF Application using XAML, I have 2 images, which needs to be
I have a WPF application which uses some library code for authentication which needs
I have a WPF application (.exe) which needs to open and display a window
I have an XBAP WPF application which displays various pages inside of a Frame.
I have a C# WPF application which uses Excel interop libraries to generate and
I have a DataGrid in a WPF application which has for its ItemsSource a
In my WPF application I have a Canvas in which I do some drawing.
I have a C# application of which some parts are written using WPF (which
I am developing an application in C# WPF which will have Client-Server architecture (Client

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.