Article about Service Locator, MVVM, and MessageBoxes

April 1, 2010

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!! 😀


My Mix 10K Submission

January 16, 2009

Microsoft is hosting a programming contest called Mix 10K.  The idea is that you can submit an application whose binary file size is no greater than ten kilobytes, and then you stand the chance to win some cool prizes.  I don’t expect to win anything, but I still had fun creating my submission: i LOVE your cursor

I know, it’s a stupid program, but I get a kick out of it.  😀


Emulating ICommandSource in Silverlight 2

November 17, 2008

I recently discovered that Silverlight 2 has the ICommand interface, but does not have ICommandSource.  Basically, this means that you cannot easily execute a command when, say, a user clicks a button.  This is pretty strange to me, and renders Silverlight’s ICommand interface next to worthless.  If you’re an MVVM zealot like me, I’m sure you must see where I’m coming from here…

So, I corrected the situation.  You can now execute commands, pass them parameters, and even honor their CanExecute status, all via some attached property magic.  Read more about it, and download the source code, here.