First this is not some newbie tutorial on what is MVVM and how to use it in . This article mostly about problem’s that you will face in real life applications using MVVM pattern with WPF and Silverlight vanilla controls library and how to solve them.
The data binding functionality in WPF has several advantages over traditional models, including a broad range of properties that inherently support data binding, flexible UI representation of data, and clean separation of business logic from UI.
This topic first discusses concepts fundamental to WPF data binding and then goes into the usage of the Binding class and other features of data binding.
I’m not biologist and I know nothing about plant classification, but it doesn’t matter in our context.
So how the application will look like: Now let’s describe our application UI: We will have plant’s category tree to the left, and to the right we will have a table showing plant’s belonging to selected category.
Before I start showing what’s wrong with MVVM in Silverlight and WPF and how to overcome it, I would like to define my position on subject: MVVM is a great pattern, WPF and Silverlight control’s library which is shipped with NET 4.0 is far from perfect for data binding development (especially Silverlight’s). To demonstrate this let’s try to develop some real life application using MVVM.
After 2 minutes of thinking I decided to develop a plant classification application.In the toolbar at the top we will have CRUD operations buttons.Table columns could very depending on selected plant category.I’ve added the download link to the original post: Happy coding 🙂 .The Silverlight 4 Tree View control, when leveraged with the Hierarchical Data Template, allows easy binding of hierarchical data.In case you did override some of the tree’s virtual methods, your project might not compile out of the box because some of these methods now receive additional parameters.