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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:15:13+00:00 2026-05-17T16:15:13+00:00

I have this application that has dynamic language switching built in. Based on the

  • 0

I have this application that has dynamic language switching built in. Based on the selected Culture, strings throughout the application will change. Translated strings and their original values come out of resource files. I use bindings to attach the resource values to buttons, labels, etc. Most of this binding occurs in the code behind.

I’ve been able to concatenate localized strings with data using the Binding.StringFormat property:

mybinding.StringFormat = "# {0}";

for “# of items”. My problem is that I now need to concatenate two (or more) localized strings in the code behind. I quickly realized I could use MultiBinding and add my bindings to it, keeping with how things currently work, however, using MultiBinding.StringFormat doesn’t seem to work. I’m trying to use myMultiBinding.StringFormat = "{0} {1}"; to insert a space between the two binding values, but it just appears blank when bound to the “Greetings” Label.

Binding b = GetBinding("HelloWorld");   
Binding b2 = GetBinding("Name");

MultiBinding multib = new MultiBinding();
multib.StringFormat = "{0} {1}";
multib.Bindings.Add(b);
multib.Bindings.Add(b2);
Greetings.SetBinding(Label.ContentProperty, multib);

and here’s the GetBinding() function which grabs a binding based on the path value:

public Binding GetBinding(string name)
{
    Binding binding = new Binding();
    binding.Source = mySource;
    binding.Path = new PropertyPath(name);
    return binding;
}

Also, I should note I’m using .NET 4. Doesn’t seem to work in Xaml either. I have also tried this in .NET 3.5 after it didn’t work in 4.0. Both child bindings are working… if I supply a converter, the values show up. I’d rather use the StringFormat property though.

  • 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-17T16:15:14+00:00Added an answer on May 17, 2026 at 4:15 pm

    It’s a problem with the Label. StringFormat on TextBlock seems to work…

    http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/69bca541-379f-4f8d-ab19-2f55b566e2c9/#1c06f05e-631c-4e51-95f4-cac83a3f457b

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

Sidebar

Related Questions

I have this web application that has grown to an unmanageable mess. I want
I have a class Application that my global.asax inherits from. The class has this
So I have this c# application that needs to ping my web server thats
I have an existing application that is written in C++ for Windows. This application
I have this code inside a class that is used by an application and
I have an application that writes information to file. This information is used post-execution
I have my Windows Application that accepts args and I use this in order
I have a large application that uses EJB 2.x entity beans (BMP). This is
I have a VB6 application that needs to update it's self. For this purpose,
I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a

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.