Article about using routed commands with MVVM

I just published an article on CodeProject that discusses a technique which simplifies the use of routed commands in an MVVM architecture.  If you’re interested, here is the link:

10 Responses to Article about using routed commands with MVVM

  1. jonahsimpson says:

    Josh, you changed your profile pic! I sure hope you’re still wearing your brain bucket while coding, prosthetic heads can be expensive…Safety first!

  2. Josh Smith says:

    Thanks for the excellent safety advice, Jonah! 😀 I wear a helmet 24/7…

  3. […] Josh Smith has added a code project article showing another approach to the same […]

  4. Chris Parnin says:

    Interesting articles you have on MVVM. But I can’t help to think that once again MS doesn’t deliver on databinding forcing people to roll their own. I did this when .NET first came out; now I feel like I would have to do it all over again just to have the basic concept of view invalidation.

  5. Josh Smith says:

    Hi Chris,

    I disagree. MS did a *freaking amazing* job on data binding in WPF. Anyways, my article and solution are about commanding, not data binding.


  6. Chris Parnin says:

    My statement was a little terse. Certainly, data binding includes the aspect of pushing and pulling data to a bounded component which is handled well.
    However, as can be seen by the comments on your articles in code project, most questions and problems revolve on the interaction and synchronization of views or bounded component (obviously control and commands have a role in this).

    In 2003, I had to basically implement a MVVM pattern to workaround issues with the older databinding framework that handle the same issues you address. I find it interesting that the same concepts have to be invented again with WPF instead of being part of the framework.

  7. John "Z-Bo" Zabroski says:

    Chris, it sounds like you should post a persuasive essay about this topic. You sound passionate about it. Obviously, no one is going to pay you for your time, but we’ll certainly appreciate it.

    Rather than just talking about WPF, it might be useful to talk about how you had to roll your own in WinForms. I find that when I explain XAML and the superiority of the WPF layout engine to people, using Java Swing Builders as a contrasting example really helps them get why the XAML WPF file format approach is superior.

  8. John "Z-Bo" Zabroski says:

    Also, I don’t think it should be the job of the core WPF team to tell people how to build applications. Since WPF is declarative, I’d rather them focus on making sure I get what I ask for, in terms of performance and crisp visuals. Stuff that I can write myself I’d prefer to write myself and *open source* it. If Microsoft bakes a module in, then they have to provide support for it. They already are way behind documenting what is currently in WPF.

    On the flip side, ultimately, when you read the books written by WPF team members, they actually offer very little insight into how to build real applications. Adam Nathan even makes comments in WPF Unleashed that discourage considering real-world scenarios. For instance, he refers to applications that can dynamically generate UI at run-time as having a “forgiving” architecture. He doesn’t explain what a “forgiving” architecture is, though! Your average OldSchoolVB coder doesn’t want XAML, your average OldSchoolVB coder wants something like an ASP.NET… a transformation langauge where they can mix code and data together. To me, this is where I’d prefer people step up and explain how to design great applications.

    Josh Smith, Karl Shifflett, M. Orcun Topdagi, Dr. WPF, Rob Eisenberg, Christopher Bennage, and Andrew Smith appear to be the ones providing the best guidance. I really appreciate them stepping up and helping out the community.

  9. John "Z-Bo" Zabroski says:

    (Someone pointed out to me that Adam Nathan is not a WPF team member. Sorry about that.)

%d bloggers like this: