Article about Service Locator, MVVM, and MessageBoxes

I just published an article titled ‘Using a Service Locator to Work with MessageBoxes in an MVVM Application‘ on CodeProject.  It’s one solution to the now canonical question of how to work with message boxes in an MVVM app, either WPF or Silverlight.  The article gives an introduction to the Service Locator pattern, in case you are not yet familiar with that concept, and then dives into an example of how to leverage it.  The end result is a simple, testable, extensible way to work with message boxes from ViewModel objects.

http://www.codeproject.com/KB/WPF/MessageBoxInMVVM.aspx

By the way, I found out today that I got the Microsoft MVP award again.  Four years in a row!  Woohoo!!😀

3 Responses to Article about Service Locator, MVVM, and MessageBoxes

  1. judahgabriel says:

    Congrats on the MVP status, Josh, you damn well deserve it.

  2. Josh Smith says:

    Thanks Judah, much appreciated!🙂

  3. Johan O says:

    Great stuff Josh!

    Smiliar to Sascha Barbers approach in Cinch, great!

    I am however missing an article where you explain how to create custom popup dialogs. That is, dialogs with ViewModels inside of them. I use an approach almost exactly like yours for solving that problem. However there are more things to think about like having a closed event on the viewmodel so that you can get notified when the user closes the dialog among other things🙂

    That would make a great article I think, i hope you can find time to create one!

    Keep it up!
    /Johan

%d bloggers like this: