This project has moved and is read-only. For the latest updates, please go here.


May 27, 2014 at 1:26 PM
Hi Guys,

I'm new to MVVMLight, and have recently found the EventArgsToCommand functionality. I have a quick question, if I'm using the PassEventArgsToCommand property and set it to true, is it possible to send extra parameters, ie. ones not included in the eventargs?
May 28, 2014 at 7:53 PM

No, because of the limitations of the ICommand interface (which is .NET, not MVVM Light), you can only pass one parameter. So it is either the CommandParameter, or the EventArgs but not both.

The work around this limitation is to create a new property in your viewmodel and to bind this property to the element that you want to observe in the UI. This way, when the command is executed, you can get access to the property in question.