Improvements made to my MVVM commanding solution

July 26, 2008

I woke up extra early this morning and just had to implement some enhancements to my recent MVVM commanding solution.  I took Bill‘s brilliant advice and made a concrete CommandSink class. That alone is a HUGE improvement!  I made a fix that allows the CommandSink attached property to work for elements in a template.  This is related to the timing issues Bill and I discussed, wherein there is no guarantee that my attached property will be invoked *after* an element’s command bindings are created and added to its CommandBindings property.  Also, I renamed RelayCommandBinding to CommandSinkBinding because I think that more accurately expresses the purpose of the class.

The article has been updated to explain the new features.  All of the important changes are in the How It Works section.  Also, the source code download was updated.  Here’s the link:

http://www.codeproject.com/KB/WPF/VMCommanding.aspx


Follow

Get every new post delivered to your Inbox.

Join 284 other followers