Archive for the ‘WPF’ category

Birthdays Synchronizer 2.0

August 17th, 2009

Today I finally released the new version of the Birthdays Synchronizer application. As I wrote in previous posts, I wanted to enhance it with a new and exciting UI, and chose WPF for this purpose.

Although my learning curve for this technology was a bit slower than I expected, I’m very pleased with the results :)

I used Expression Blend 2 for designing the UI and animation (or storyboard…) and MVVM pattern for the acutal development. While working with WPF I faced more than one gotcha (it has some issues after all..), but eventually I managed to overcome them all. Microsoft did amazing work on this technology, which offers so many possibilities and really changes the way desktop applications are developed and displayed.
Beside the UI changes, the new version also interacts with Google Calendar, allowing to synchronize the birthdays to this calendar in a very special way:
If in a certain day you should be reminded for a friend’s birthday, a little cake will show up on the top of this day reminding you of it. It also shows the picture and name of the person when clicking on it..
In the coming posts I will elaborate more on this integration and some of the things I had to overcome with WPF.

Getting started with MVVM and WPF

July 28th, 2009

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 :)