0

I'm creating a customer search screen in WPF, trying to follow the MVVM pattern. My scenario is I have three possible search options at present:Customer surname; Customer Reference no; Customer with follow up due in x number days.

I have a grid with 3 rows, one for each search available. A radio button for each to identify which search user wants to perform and a button. I am going to add commands to my view model for each but in XAML how would I set correct command and pass correct parameter to the command? Only way I can think is 3 buttons and collapse the two non applicable???????? This sounds a sweaty hack....

Anyone point me to correct method?

Thanks

CheGuevarasBeret
  • 1,364
  • 2
  • 14
  • 33

1 Answers1

0

Sounds like you just need 1 TextBox, 1 Button and a few bounded RadioButtons.

Then use MultiBinding on the Command's CommandParameter to pass both the text and the value of the choosen RadioButton (which are both binded to values in the ViewModel)

Community
  • 1
  • 1
Blachshma
  • 17,097
  • 4
  • 58
  • 72