MVVM pain points: ICommand, y u no implementation?

One of the things that bugs me about C# MVVM development is how important ICommands are, yet no standard/reference implementation is provided in the BCL. It’s practically a rite of passage for C# devs to write a half-assed, fragile, and sloppy ICommand implementation.

Are there really that many variations of ICommand implementations? I guess there might be a use case where a dev would encapsulate a bunch of business logic into a domain-specific ICommand implementation, but for the most part, ICommands tend to be containers for lambdas that exist in the ViewModel (usually because they need to reference the ViewModel and have access to its private members).

One of the flavors of DelegateCommand/DelegateCommand<T> should have been included in the BCL. In the meantime, you’ve got plenty to choose from – currently i’m using DelegateCommand in Prism.

Feedback Welcome

What do you think? Am I on target, or off my rocker? Can you suggest a better solution? I’m always looking for a better way!

Leave a comment or drop me a line on twitter!

One thought on “MVVM pain points: ICommand, y u no implementation?

  1. Pingback: MVVM pain points | PhilChuang.com

Leave a Reply