Category: Silverlight

NET Event–Migrating WinForm application

Last month (21st of July 2011) I spoke at the Bermuda NET Event “Migrating WinForm applications to WPF/Silverlight”. This has been for me the first NET Event in Bermuda but for sure it will not be the last one. We are planning to have a new event this autumn where we will touch other topics like: ALM, Parallels and more.

Thanks to Alessio Bellisomi, the web developer that works in my company, I am able to share with you some nice pictures of the event and three short movie of the event. Unfortunately, for this event, we were not super organized so I do not have with me the full video of the entire event. I promise that for the next event we will provide the entire video and maybe we will be also able to stream the content.

The audience, considering that we were in Bermuda and considering that it was end of July, was more than expected. I believe we were around a 30/40 ish attendees. The feedback has been really positive and we expect a very fast grow of this UserGroup by having more events and more speakers.


The pictures are available through Google photos



The videos have been hosted on my Vimeo account and they can be viewed through their web site

Bermuda WinForm event, part 01 from Raffaele Garofalo on Vimeo.

Bermuda WinForm event, part 02 from Raffaele Garofalo on Vimeo.

Bermuda WinForm, part 03 from Raffaele Garofalo on Vimeo.


Special thanks need to go to Sandra de Silva (president of the UG and owner of Nova Ltd) and to the other members of the committee. I want also to thank all the participants and I hope this autumn there will be more!

Speaking about WPF in Bermuda.

Last year in Bermuda we had a new born, a NET community. The community has been created by some locals companies to attract developers, architects and analyst; but also anybody passionate of development.

You can check-out the web site here:

This month I will have the opportunity to present my two books:

and to talk about WPF/Silverlight.

During this event I will explain what are the common problems you may encounter when moving from legacy applications to WPF/Silverlight. When you should and when you should not migrate an application to a new UI technology. When you should use WPF and when you should use Silverlight. Oh and I will also give some free copies of my books plus some additional discounts.

This is the page of the event:

If you are planning a vacation around the 21st of July, please come here and join us in this first event about WPF/Silverlight.

Hope to see you there!

PS: I forgot to mention that one of the amazing price for the attendees is to win a 1 year subscription to MSDN.

Updates for my Microsoft Book

After one week that my book about LOB applications has been published I started to receive some additional questions that I am trying to address in this post.

First of all I want to thank all the guys and girls that are buying the book and all the people that are providing feedbacks for the book. I really appreciate. I want also to specify that the Microsoft book has not been released as a “Book about MVVM” but more as a “book to discover LOB and layered applications”. I believe that part of the misunderstanding as been caused by the book’s title but we wanted to specify the MVVM keyword in the title because the book spent two chapters on it.

The source code has been published and you can find in the book the correct address that will point you to the download. I want to thanks Ted Anderson that on has notified me about the error done by OReilly in the publishing address. The source code is available here:­ Please do not download the code and pretend to get explanations from my if you didn’t buy the book yet … Winking smile

The T-SQL to generate the database is not necessary. When you will open the Visual Studio 2010 solution, you need to run the Test show here:

TDD for generate the SQL Datab
  1. [TestFixtureSetUp]
  2. public void CanCreateDatabaseSchema()
  3. {
  4.     try
  5.     {
  6.         var cfg = new Configuration();
  7.         cfg.Configure();
  8.         cfg.AddAssembly(Assembly.Load(“CRM.Dal.Nhibernate”));
  9.         new SchemaExport(cfg).Execute(true, true, false);
  10.     }
  11.     catch (Exception exception)
  12.     {
  13.         Assert.Fail(exception.ToString());
  14.     }
  15. }
  17. [Test]
  18. public void CanGetAUnitOfWork()
  19. {
  20.     try
  21.     {
  22.         ISessionFactory factory = new SessionFactory();
  23.         IUnitOfWork unitOfWork = factory.CurrentUoW;
  24.         Assert.That(unitOfWork, Is.Not.Null);
  25.         Assert.That(unitOfWork.Orm, Is.Not.Null);
  26.     }
  27.     catch (Exception exception)
  28.     {
  29.         Assert.Fail(exception.ToString());
  30.     }
  31. }



Also remember that the source code has been created only to show you some practical examples of how to layer a LOB application, how to use NHibernate or Entity Framework with the same data layer and how to architect the MVVM pattern. If you want to use the application in a production environment, you have to spent additional time on it in order to get a final product.

For any other additional information I am here.

Please if you find errors or mistakes in the book, I would really appreciate if you can post an errata corrigge in the corresponding section of the OReilly web site:

Next month I will publish my second book “Applied WPF in Context” with APRESS; in that book you will find whatever you need to learn WPF and the MVVM pattern.

Stay tuned!

Source code for my MVVM book.

This post is an update for all the enquires I got about the source code for my MVVM book published few days ago. (Please follow this thread: MVVM book).

The book was planned to be published for the first week of April 2011 but it was already published this week due to the high demand we received from the customers.

Unfortunately the source code of the demo application is under polishing process in these days and it will be available next week.

Please forgive me for this and stay tuned, I will update this post as soon as the source code will be released.

Thank you

My book for Model View ViewModel (MVVM) and n-tier applications is out

(a.k.a. Buy one copy!)

Finally I am excited and glad to let you know that my first book: “Building Enterprise Applications with Windows® Presentation Foundation and the Model View ViewModel Pattern” is out and available through the major IT books distributors like:, kindle, and more.



Please forgive me if I am missing some of my distributors but I do not have yet the full list. The book is available through the oReilly website at this address: in the following formats: PDF, EBOOK, KINDLE and PAPERBACK (hard copy); of course the hard copy costs a little bit more.

You can also order the book using at this address; unfortunately, Amazon will not start to deliver the book until the 1st week of April 2011 while if you order the book from the oReilly web site, you can get it right away.


On amazon, the hard copy costs $19.99 and the Kindle version costs $14.99.

On oReilly the hard copy is $19.99, the Ebook is $14.99 and both together cost $21.99

Free Copies

I have assigned some free copies to the participants of the last UGIALT conference, I will send them a free copy of the book as soon as I will get the green light from oReilly. I am planning to distribute other free copies at the next .NET community event and I will let you know when this will be. For now, buy a copy and make me happy! Open-mouthed smile


First of all I want to thanks oReilly and Microsoft to let me write this book. I also want to thank Russell Jones, my editor and primary publishing contact for this book. He is the only person who believed in me from the beginning, and he put himself on the line to get this project approved by Microsoft Press. I will be always thankful to him for that. He did also a wonderful job in helping me to complete the job on time, and to organize the whole project. Thanks to Kristen Borg, my production editor that spent a lot of time and effort to finalize and get this project done.

Of course I have to thank my wonderful wife that for the last 6 months she helped me in getting this job done by pushing me every time I was letting go the project for one or another one reason.


Please, please, please. If you plan to buy a copy of the book ( I hope so) I would really appreciate if you can leave a comment, on Amazon or on OReilly or on both of them and let me know what you really think about it. I love to get constructive criticisms on my work as they always help me to do the next thing better. Please, don’t be shy and don’t be nice if I do not deserve it!


I have received already a lot of requests about the book and the distribution. So, if you want an hard copy or an ebook you can get one, right away on the OReilly web site. If you go on, the book, the Kindle version or the EBook will not be distributed until the end of March 2011. If you need details about the book content, I am planning to write a new blog post ASAP.

News for MVVM lovers and MVVM Books.

A lot of things are going here, on my side I am publishing two books about WPF and more in general about MVVM and Prism; on another side someone pretty cool (Karl Shifflett) has just released a new way of delivering tutorials and lessons within the Visual Studio 2010 UI, the tool is called InTheBox. Finally, the team of Patterns and Practices is making progress on Prism and a new drop has been released on Codeplex.

In The Box and Feature Builder

InTheBox is a new way of delivering mentoring through the UI of Visual Studio 2010. The idea has been introduced a while ago whit the plug-in for Visual Studio called Feature Builder; with this plug-in, you can create  dynamic guidance for your applications and deliver them with your Visual Studio solution templates or item templates.

The following picture is a screen shot of how it appears in Visual Studio 2010; if you are interested in learning MVVM this is a good starting point but I believe Karl and his great Team should put more information in the documentation attached with the MVVM Training kit.


I am personally using the core engine of Feature Builder power tools to deliver some guidance also in my office and I found the tool and the automation API delivered with Visual Studio 2010 pretty interesting; unfortunately, as usual, the documentation is pretty poor and it still lacks of features right now.

Screen shot 2010-12-07 at 11.02.52 PM

Prism V 4.0

Last month, more precisely, in the middle of November 2010, the team of Patterns and Practices has released a new version of Prism, the V 4.0 which is probably (in my opinion) the more stable and complete version of this amazing framework that allows you to build composite UI application with WPF or Silverlight.

The release has been announced here: and it’s available for download at the same address.

I am posting here some of the cool features that has been introduce with this release of Prism; feel free to go to the Codeplex community web site and have a look at Prism, trust me, Microsoft did a great job!

  • Prism is now available for WPF 4, Silverlight 4 and Windows Phone 7
  • It is delivered with the full source code and with all the assemblies already full signed
  • Well done and complete documentation plus sample applications for WPF and Silverlight

A big thanks has to go to Karl Shifflett which is making a great job on the PRISM community and also to me technical review David Hill which is another big of the team of Patterns and Practices.

My Books

Two or three weeks ago a friend of mine discovered that my books were available on Amazon for pre-order; I was personally shocked about that as no one of my editors told me anything about that.

By the way, now that the news is almost semi official I am going to publish in this post the two covers of my books. They are two total different books as they focus on two different things. The first one is released by MICROSOFT PRESS and it has been done in collaboration with David Hill (David is a Microsoft Solution Architect and right now is working at the team of PRISM in the Microsoft division of Patterns and Practices), which is my technical reviewer; it talks about architectural and UI patterns you should adopt when you build a LOB application with WPF or Silverlight. The second one is part of a new series of books APRESS is writing which is entitled “In context”; in this series and more precisely in my book, I talk about how to write, from scratch a dynamic and well done WPF application by using all the features available in Expression Blend and Visual Studio 2010.

As  you can understand, the first book is more an architectural book for an audience that has already worked with WPF or Silverlight while the second one is a for dummy book on WPF.

Said that, you should buy both and read them as soon as they will be available on Amazon the next Spring!! Smile

Building Enterprise Applications with Windows Presentation Foundation and the Model View ViewModel Pattern

Applied WPF 4 in Context

Build enterprise application with WPF, WCF, Entity Framework and Prism. Tutorial 01.

Update: source code and documentation are now available on CodePlex at this address:

In these series of articles I will show you how to build an enterprise application using the most recent Microsoft’s technologies like: WPF with PRISM for the UI, Entity Framework for the Data Layer and WCF for the persistence service.


We will build a 3 tiers application that will spread the responsibility through 3 different machines (virtually because the Visual Studio solution is only one).

  1. SQL Server
    It will contain the database and the database objects
  2. IIS 7
    Data access layer with Entity Framework
    WCF host service for the persistence
    WCF host service for the security access
  3. PRISM (Composite WPF application)
    This layer will use the PRISM pattern to render a WPF modular application

This is the schema of our tiers:


Prerequisites and Source code.

As I did for my previous series of post about MVVM and WPF, I will share a CodePlex project for anyone of you that want to reuse the project for professional or testing purposes, I will use the Adventure works database available in the CodePlex web site and I will use the PRISM pattern.


  1. Visual Studio 2008 with SP1 available for trial on Microsoft web site.
  2. NET 3.5 SP1 available on MSDN.
  3. SQL Server 2008 Express Edition.

As we are going to use some very well known patterns and methodologies, like: Factory pattern, Inversion of Control, POCO objects, Test Driven Development; I suggest to anyone of you to have a look at:

  1. Martin Fowler articles and patterns.
  2. Gang of Four NET patterns.
  3. Composite UI Application for Silverlight and WPF.
  4. At least, basic knowledge of XAML syntax and how WPF works.

Those are part of the patterns and methodologies we will use. It is not mandatory to know them but if you have at least a look, it will be easier to follow the next articles.

For today it’s enough, be ready with your PC and from the next article we will start to build the database and the Data access layer.


WPF and MVVM tutorial 01, Introduction.

With Microsoft WPF technology, a new pattern is born and is going to be called MVVM (Model View ViewModel). This pattern is an hybrid from the old MVC and the old MVP patterns. Why a new pattern for the presentation?

  1. First of all WPF technology is giving us a kind of technology that can completely change the approach to design and code the UI. With the VMMV we can completely design an agnostic UI that doesn’t know the Model we are going to pass to it.
  2. Recycle, I will show you in this tutorial how to simply convert a WPF application into a Silverlight app.
  3. Better delegation and better design for a real n-tier application. In this example we will use LinqToSQL and WPF to build a complete n-tier application with the VMMV.
  4. Something that I do not like, TESTING THE UI!! Yes we can test the UI with WPF and VMMV combination.
  5. Abstractation. Now the view can be really abstract and you can use just a generic.xaml file and then give a style template to your model.

This is the schema (in my opinion) on how it should work an application with WPF and the VMMV implementation:


  • MODEL: anyone that has already worked on an n-tier application knows what it is. The model is the group of entities that will be exposed.
  • VIEW: the view is the graphical code XAML used to generate the UI, nothing more then that.
  • VIEWMODEL: the model for the view … or … the view for the model?! Anyway is a model of the view.

Before starting this tutorial I suggest you to download:

The next tutorial will show you how to create a simple DAL layer with LinQtoSQL and how we can implement the Unit of Work pattern to build a simple but solid data layer for our application.

You can also download the Visual Studio template here.


NET RIA Service, #Part1 install.

In these series of posts I want to show how easy is to work with Visual Studio 2010, Silverlight 3 beta and the NET RIA Service.

Prerequisites and tutorials.

First of all we need to know what is NET RIA Service and how they can help us to write better business RIA applications.

NOTE: Unfortunately NET RIA will NOT work with the beta1 preview of Visual Studio 2010 so I recommend to use them into VS 2008 SP1.

Brad Adams and NET RIA Service overview has a very interesting post about the architecture of NET RIA Service.

Then, you must also watch the web cast at the MIX 2009. This will give a real touch of this technology that I am loving!

After all, you need now to work with the NET RIA service. I am going to write a series of posts about that, but you can also follow the tutorials over the web.

In order to develop with Silverlight 3 beta you need:

If you plan to work with Windows 7 and Visual Studio 2010, you can have a look also at my post on How to RDP into a Windows 7 virtual machine.

After that you will be able to follow my tutorials.

Silverlight UserGroup Starter Kit

I have an exiting news today.

A couple of days ago, one of my friends David Silverlight asked me about a new project called Silverlight UserGroup Web Starter Kit. At the beginning I was afraid about the free time that I do not have but then I tough “this should be a good way to learn RIA services and EF in depth” …

So here we go. This is the codeplex address: and the project seems to be really cool, especially for the people that are going to work with me.

Oh boy, finally I can be part of a challenging project using Entity Framework, RIA services and C#.

Stay tuned!