Published
Friday, February 17, 2006 1:28 AM
by
mtaulty
I spent a few years writing MFC code towards the end of the 1990's. One of my favourite things about the MFC was that it had a framework built into it for dealing with commands that the user executed. That framework dealt with whether the command was currently applicable or not (perhaps by enabling/disabling that piece of the UI) and it also dealt with routing the invocation of the command to a piece of code that could handle it (like a View or a Document).
When Windows Forms came along I was shocked to find that it didn't have any kind of mechanism that provided the same kind of functionality that MFC had in this area of command routing. You can build one but it's not there in the box which means that controls that you buy and download and so on won't automatically take part in any existing infrastructure.
With the WPF the idea of a built in command mechanism is back and it's back with a vengeance.
There's a
great new article just gone up on the MSDN site that explains at a high level how the WPF command infrastructure works and what it can do for you. There's not a lot of documentation out there right now as to how this works (although
IanG has written well on it) so this is a welcome addition.