Getting started with MVVM and WPF

For some time I am working on enhancing my Birthdays Synchronizer application. The last modification I made is to support Google calendar. But before releasing it I decided to upgrade the application look & feel to something more appealing.. :)

Since Iā€™m quite experienced with the .NET framework, I decided to give it a shot and implement the change with WPF.

When I just started the development, I found that the MCV pattern is not working so well with WPF. This is mainly because the view layer of WPF, based on XAMLs, has enormous capabilities (the bindings in particular) which make it hard to follow the traditional controller-viewer separation.

Here comes the part where MVVM pattern comes in hand. MVVM stands for Model, View and View Model. The model is the data object we are working on. For example, a birthday object, consisting from the person name and birthday date. The View Model is the layer responsible for the business logic and the operations that supports the view. For example, saving the birthdays to Outlook or getting from Outlook the available calendar folders. The view is the actual UI. It relays on the View Model while the View Model itself is not relay on any view. This point is important to follow and understand. It means that the View uses the View Model for its operations, but the View Model must not know that it works with any specific view.

If you are just getting started with WPF development, I really recommend using the WPF MVVM toolkit. It adds a solution template to visual studio which allows you to create WPF projects following the MVVM pattern. The projects it creates have built-in solution folders for each MVVM layer and some classes to get you started. It also comes with a great document describing the MVVM patters in details and in a simplified language.

Good luck :)

Free, Working Source Control

After going through a rough semester, I finally have time to get back to the things I like..!

In this post I would like to talk about source controls.

During my last semester, I had to develop several projects together with my group. I searched for a way that we could work efficiently, just like in my real job where we develop in teams. Therefore I looked for a free source control solution. I wanted it to be simple to install, integrated into VS 2008 and most important ā€“ free.

After some trials and errors, I found almost all the things wanted from a source control hosting in xp-dev.com. This site offers free on-line subversion hosting (SVN) that supports all the features needed from a standard source control (versioning, multiple users, branching, etc) and it comes with 500MB storage waiting just for your usage. Since it is on-line, there is no need to deploy any server of your own.

The second thing that I needed is to integrate it into Visual Studio, so it will be simple and intuitive for the developers in my group. So I got a recommendation to use the AnkhSVN plug-in.. They really had done a good job with it! This open source plug-in installs easily and allows you to do almost everything from your IDE (once you connect it to your account with xp-dev): check-in, check-out, diff, branching, merging and much more. It really reminds the Visual Studio team systems except that there is no option to manage tasks.

Using these solutions allowed us to make our work in a group fast and very efficient ā€“ no more sending the code over mail, looking manually for the last changes and searching for older versions by looking in our Gmail accounts. During our intensive work on our project these free solutions did not fail us even once.

So if you ever need a free solution like that, even for your own projects ā€“ you should try it out.