Home Forums Software Development What is the correct way to practice MVVM Pattern for WPF app,

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2485
    Stan Yu
    Participant

    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.

    #2500
    Patrik [Tobii]
    Participant

    Hello Stan,

    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?

    Best regards
    Patrik

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.