Home › Forums › Software Development › What is the correct way to practice MVVM Pattern for WPF app,
Tagged: WPF MVVM
- This topic has 1 reply, 2 voices, and was last updated 8 years, 1 month ago by Patrik [Tobii].
- 07/02/2015 at 18:42 #2485Stan YuParticipant
Hi there, I gotta say the .net sdk is awesome and many out of box features are available for WPF app, however if I want to cater the following goal with MVVM pattern, what it the best approach to do it?
1. A control is registered gaze aware event, how can I route an event to a command in viewmodel? I suppose I can use EventToCommand binding from MVVM Light to achieve that. Or there is a better way of doing it.
2. The preceding control binds to a property from viewmodel, can be an object , how can I pass this bound object to command method in viewmodel by gazing on this control to trigger the command ?
Thank u.09/02/2015 at 11:08 #2500Patrik [Tobii]Participant
1. I am not an MVVM Light expert, but I get the impression that EventToCommand is the simplest way to route an event to a command in a view model. Another candidate might be InvokeCommandAction but I haven’t tried this personally.
2. I’m not 100% sure if I understand the question, but maybe a binding to the EventToCommand declaration via the CommandParameter property is what you’re looking for?
- You must be logged in to reply to this topic.