views:

833

answers:

1

I have a DataTemplate containing an Image. To the Image I added a ContextMenu with a MenuItem. To the MenuItem I associated a command. I then handle the command in the view using the DataTemplate.

In the CanExecute handler I have e.CanExecute = true. But the Executed handler is never executed. If I remove the Command assignment the MenuItem, the Menu is shown correctly when I right-click on the Image.

What am I doing wrong?

Thanks!

A: 

I figured this out - After e.CanExecute = true; I had a MessageBox.Show, adn this was preventing the Executed to be called. I am not sure why though.

Gustavo Cavalcanti