Freigeben über


Model-View-ViewModel

In preparing my example of Model-View-ViewModel I had a lot of help from Adrian Sanchez, who previewed the code and asked me questions about it.  It was a big help in figuring out what needed explanation.  When I started on Expression I heard about the pattern, and for a long time it was confusing, then suddenly one day it was obvious.  The good news is after going through the example, Adrian said he understood the feeling:  he now has to explain it to his colleagues.

Adrian also made an important observation:  WPF uses the Model-View-ViewModel pattern.  WPF controls are designed to be "look independent"...a Button is simply something that can be clicked and has focus etc., the Button class says nothing about whether the object is rectangular or round, or even has 3D components...that is determined by its Style and Template.  Java Swing is similar:  what they call a ButtonModel, WPF calls a Button and I would classify as a ButtonViewModel!

Comments