views:

439

answers:

2

Anyone who has tried to implement RoutedCommands in WPF using M-V-VM has undoubtedly run into issues. Commands (non-UI commands that is) should be implemented in the ViewModel. For instance if I needed to save a CustomerViewModel then I would implement that as a command directly on my CustomerViewModel. However if I wanted to pop up a window to show the users addresses I would implement a ShowCustomerAddress command directly in the view since this a UI specific function.

How do I define the command bindings in the viewmodel, and use them in the view?

+2  A: 

Here is a solution that I came up with.

Micah
+2  A: 

I arrived to the same solution... and I also wrote a blog entry about it :)

You can find it here.

DaniCE