Vladimir Kramar

Vladimir Kramar

  • NA
  • 3
  • 2.6k

CommandParameter Binding

Nov 30 2011 12:59 PM
Hi All,

I need to pass two parameters to my Button's command parameter. I have ComboBox and TextBox contrlos and I need to pass one value from ComboBox and other one from TextBox to the CommandParameter. I am trying to use MVVM pattern therefore my button calls ICommand implementation and thus it needs these two parameters.

As I investigated I could not implement it by means of XAML but I still believe that there is a way how to do this. Anyway if this is impossible I think MVVM is junk because we are able to use it only in primitive cases.

So, please help what to write here:
<Button x:Name="OKButton" Content="OK" Command="{Binding Path=AddNewItemCommand, Source={StaticResource VM}}" CommandParameter="???" ...

Thank you a lot!

Answers (1)