tags:

views:

161

answers:

1

I've been using EventToCommand from the MVVM toolkit, but sometimes I the EventToCommand does not seem to be firing on the event that it is mapped to.

I think this has something to do with setting the DataContext? At this point that is simply a guess.

Perhaps a better question would be: I often hit the break point that the EventToCommand syntax refers to, but does not execute when the event occurs. When I subcribe to the event in question in the code behind - I hit a the breakpoint!

Is there any debugging techiques to understand why the imperative code does not get executed, after the command member has be retrieved?

Regards, Richard

A: 

Check the Output window at runtime to see if there are any errors that are being handled and written to output instead of throwing a runtime exception.

Also, you can try bringing the Galasoft.MvvmLight.Extras project into your solution, and changing your reference to point to it. That will let you debug through the code to see if something is failing there. If you do this, I would suggest putting a breakpoint in the OnAttached() method.

Is this an intermittent issue? What does the XAML look like?

Matt Casto