-1

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>
Archana
  • 75
  • 8

1 Answers1

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>
Alp
  • 358
  • 5
  • 12