0

In my WPF application, I have a window whose title is a 2 word string. First word, i need to bind to a ViewModel property and second word, I need to get from resource file as i need to apply localization to that word.

I am not sure how to bind these two different things in the window title. I want something like the below one.

<Window Title= "Viewmodel Property + static resource property">
</Window>
0

1 Answer 1

2

You can set a MultiBinding like that.

<Window ...>
   <Window.Title>
      <MultiBinding StringFormat=" {0} {1}">
         <Binding Path="ViewModelProperty"/>
         <Binding Source="{x:Static local:YourStaticProperty}"/>
      </MultiBinding>
   </Window.Title>
   ...
</Window>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.