Published articles on other web sites*

Published articles on other web sites*
Showing posts with label MvvM. Show all posts
Showing posts with label MvvM. Show all posts

MvvM


The Basics of MVVM

While training and consulting with clients around the country, I find that many developers still have trouble grasping the concept of Model-View-View Model (MVVM) as used in Silverlight or WPF. In this blog post I thought I would show two examples side-by-side to help you learn how to move from the more traditional model of development to MVVM.
Why use MVVM
The reasons why programmers are adopting MVVM or the Model View Controller (MVC) design patterns are the same reasons why programmers adopted Object Oriented Programming (OOP) almost 30 years ago: reusability, maintainability and testability. Wrapping the logic of your application into classes allows you to reuse those classes in many different applications. Maintaining logic in classes allows you to fix any bugs in just one place and any other classes using that class automatically get the fix. When you don’t use global variables in an application, testing your application becomes much simpler. Wrapping all variables and logic that operates upon those variables into one class allows you to create a set of tests to check each property and method in the class quickly and easily.
The thing to remember with MVVM and MVC is all you are doing is moving more of the logic out of the User Interface (UI) and into a class that simply has properties and methods that you will bind to the user interface. One example of the type of logic you move into a class is setting the DataContext property of a list box (in Silverlight/WPF) when you want to display a collection of objects in that list box control. Instead of setting the DataContext property directly you simply set a property in the class where you load that collection of objects. If you bind this property to the list box control then the list box will automatically redraw itself when this property changes.

My MVVM talk’s material is online (#uktechdays)

Quick announcement: I just had the extreme pleasure to talk at the UK TechDays online conference (organized over LiveMeeting) and had about 100 persons in the session, thanks to all for allowing me to talk to you about MVVM!
I just pushed the whole sample code as well as the slides to a SkyDrive folder, so feel free to download and experiment.
And don’t forget:
The session was recorded, and I will announce in this space when it is online for your (re-)viewing pleasure.
Cheers,
Laurent

MVVM Light V4 preview (BL0014) release notes

MVVM_WhiteText_BL0014
I just pushed to Codeplex an update to the MVVM Light source code. This is an early preview containing some of the features that I want to release later under the version 4. If you find these features useful for your project, please download the source code and build the assemblies. I will appreciate greatly any issue report.
This version is labeled “V4.0.0.0/BL0014”. The “BL” string is an old habit that we used in my days at Siemens Building Technologies, called a “base level”. Somehow I like this way of incrementing the “base level” independently of any other consideration (such as alpha, beta, CTP, RTM etc) and continue to use it to tag my software versions. In Microsoft parlance, you could say that this is an early CTP of MVVM Light V4.

Caveat

MVVM Light V4 preview 3 (BL16, MIX11 edition!!) #mvvmlight

At MIX11, I am releasing a new preview of MVVM Light version 4. This new preview contains one small change and one large change.

ObservableObject replaces NotifyPropertyChanged

In the previous preview, I introduced a new class named NotifyPropertyChanged. However, I got a few suggestions to rename this class to ObservableObject, which is indeed a better name. In BL16, NotifyPropertyChanged was deleted and replaced by ObservableObject. Nothing else changes, just the name.
ObservableObject is a very simple implementation of INotifyPropertyChanged suitable for data objects (in the Model, typically) that need to raise the PropertyChanged event, but that are not quite ViewModels. In my MIX11 session, I demo a usage of ObservableObject to build an application using JSON. In WCF, we don’t really need ObservableObject, since all the generated proxies will automatically implement INotifyPropertyChanged.
We have:


Silverlight Bootcamp Slides and MVVM Demo

Mike Taulty and I hosted a 3.5 hour Silverlight bootcamp at MIX11 this year (Mike will be posting all of the slides and demos on his site soon, including mine. I’ll link to it when it is up. For the record, I held him up Smile .)

The topic for the last hour of the bootcamp was MVVM and “Hooking Up”. I demonstrated some quick tips on MVVM concepts and then walked through a scenario where Mike played the designer (who was actually my friend and colleague Arturo Toledo) and I played the developer. This was a real story where where Arturo and I worked through the MVVM demo in a matter of 3 days.

image

The deck walks through the fundamentals of MVVM first and why abstraction and design time data are important. Then I begin the story and show how Arturo starts with wireframes, goes to
Related Posts Plugin for WordPress, Blogger...