1

How can I pass 2 parameters with CommandParameter to the command

<Button Command="{Binding NavCommand}" CommandParameter="string1 and string2" >
  • That's not possible as I know – Mighty Badaboom Apr 01 '17 at 22:27
  • Is there any way to do this? To pass an array or something like this – Fatasy Razer Apr 01 '17 at 22:33
  • An alternative is to use multibinding and a converter: http://stackoverflow.com/a/9108585/869621 – Kevin Gosse Apr 01 '17 at 22:55
  • `CommandParameter` is necessarily only ever one value. However, you can combine multiple values into a single object and pass that single object. If you need to _bind_ source properties to the parameter, then using `IMultiValueConverter` would be warranted. Otherwise, you can just construct the simple parameter object and pass it directly (you'll have to specify the `CommandParameter` value in a separate `Button.CommandParameter` element, instead of as a text attribute). – Peter Duniho Apr 01 '17 at 23:09

0 Answers0