<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>ALNERNETIVE</title>
        <link>http://blog.alner.net/Default.aspx</link>
        <description>Alternative .NET Development Ideas - Alner.net</description>
        <language>en-US</language>
        <copyright>Nathan Allen-Wagner</copyright>
        <managingEditor>nathan@alner.net</managingEditor>
        <generator>Subtext Version 2.0.0.43</generator>
        <image>
            <title>ALNERNETIVE</title>
            <url>http://blog.alner.net/images/RSS2Image.gif</url>
            <link>http://blog.alner.net/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Faster Builds from Visual Studio</title>
            <category>Software Development</category>
            <link>http://blog.alner.net/archive/2010/06/15/faster-builds-from-visual-studio.aspx</link>
            <description>&lt;p&gt;Just a quick note on something that helped me get my solutions builds to run faster as I develop. &lt;/p&gt;  &lt;p&gt;First off, I’ll admit that “Faster Builds” is a bit of a stretch. I’m not actually making VS compile faster. Rather, I’m reducing the amount of time I waste waiting for a build to complete.&lt;/p&gt;  &lt;h3&gt;Time Consuming Builds…&lt;/h3&gt;  &lt;p&gt;Some solutions have a ton of stuff going on in their compilation process:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Numerous projects (presentation, business, data, etc)&lt;/li&gt;    &lt;li&gt;Unit tests (maybe one per project)&lt;/li&gt;    &lt;li&gt;Static code analysis&lt;/li&gt;    &lt;li&gt;NDepend&lt;/li&gt;    &lt;li&gt;Etc.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;It’s relevant to point out that solutions have a certain order that they build their projects. This is automatically determined based on the inter-project references. Projects that are a dependency of many other projects must be built first. Making a change to one of these “root” projects means that everything else must be rebuilt too.&lt;/p&gt;  &lt;p&gt;In some of these cases, building the entire solution can take some time, especially when the changes are in one of the “root” projects that is built first. I found this a bit annoying, especially when it returns with an error. But what to do? I don’t want to turn off the safety nets that the static code analysis or NDepend offers. I don’t want to unload projects or remove them from the solution.&lt;/p&gt;  &lt;h3&gt;Building Selected Projects&lt;/h3&gt;  &lt;p&gt;The thing that seems to be working well for me so far is to &lt;em&gt;build individual projects&lt;/em&gt;. If there is an error in the DTO project’s classes, then I only have to build one or two projects to find out, rather then building the whole solution. This saves a fair bit of time because I can get the DTO project working and then move on to other projects.&lt;/p&gt;  &lt;h3&gt;Setting up the Shortcut Key&lt;/h3&gt;  &lt;p&gt;You can build a specific project by right clicking on it, or by selecting it and then using the file menu. But, again, even that is kind of annoying. I’m a fan of “CTL+SHIFT+B” to build solutions. The problem is that VS doesn’t seem to have a built in shortcut key for “Build Selected Project”. Luckily, you can change this by editing the VS options:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/FasterBuildsfromVisualStudio_BAB0/image_2.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VS2010 Keyboard Options" border="0" alt="VS2010 Keyboard Options" src="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/FasterBuildsfromVisualStudio_BAB0/image_thumb.png" width="761" height="444" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;By default, the “Build.BuildSelection” command has no shortcut key. I tried a couple options and settled on “ALT+B”. This didn’t appear to be in use and was relatively comfortable for me to access.&lt;/p&gt;  &lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/119.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/06/15/faster-builds-from-visual-studio.aspx</guid>
            <pubDate>Tue, 15 Jun 2010 04:00:00 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/119.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/06/15/faster-builds-from-visual-studio.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/119.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/119.aspx</trackback:ping>
        </item>
        <item>
            <title>Be careful about with e.Handled in mouse or keyboard events</title>
            <category>WPF</category>
            <category>Software Development</category>
            <link>http://blog.alner.net/archive/2010/06/10/wpf-e.handled-preventing-focus.aspx</link>
            <description>&lt;p&gt;Today, I finally resolved an issue that I thought was related to WPF’s focus implementation. For some reason, I couldn’t get certain elements to get focus when I clicked on them. This was messing up a number of other things, including keyboard interactions and routed commands. I thought that I had some strange scenario that was preventing focus from going to my canvas. Maybe some issue with FocusScopes? Maybe the control wasn’t Focusable?&lt;/p&gt;  &lt;p&gt;It turns out that I had a number of event handlers set up for clicking, dragging, etc. In these, I was setting &lt;font face="Courier New"&gt;e.handled = true&lt;/font&gt;. &lt;strong&gt;Not good!&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There are cases where you’ll want to set e.handled to true, but be careful. In my case, this prevented a mouse click from moving focus to the control.&lt;/p&gt;  &lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/118.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/06/10/wpf-e.handled-preventing-focus.aspx</guid>
            <pubDate>Thu, 10 Jun 2010 19:54:00 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/118.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/06/10/wpf-e.handled-preventing-focus.aspx#feedback</comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/118.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/118.aspx</trackback:ping>
        </item>
        <item>
            <title>WPF Routed Commands + MVVM</title>
            <category>WPF</category>
            <category>Software Development</category>
            <link>http://blog.alner.net/archive/2010/06/10/wpf-routedcommands-with-mvvm.aspx</link>
            <description>&lt;p&gt;A lot of the MVVM guidance around commands suggest using a generic ICommand implementation, such as the RelayCommand or GenericCommand implementations. These are great for UI pieces that are bound directly to an underlying ViewModel and I use them frequently. &lt;/p&gt;  &lt;p&gt;There are still cases where a RoutedUICommand is exactly what one needs. Take, for instance, toolbar buttons or menu items that need to act on pages that are loaded in a WPF frame. In this case, a RoutedUICommand is appropriate since it is decoupled from the page, which may or may not be loaded at the time.&lt;/p&gt;  &lt;p&gt;One challenge with MVVM based scenarios is connecting a routed command to an implementation that lives in the ViewModel. As usual, &lt;a href="http://joshsmithonwpf.wordpress.com/" target="_blank"&gt;Josh Smith&lt;/a&gt; has an solution… Josh wrote a &lt;a href="http://www.codeproject.com/KB/WPF/VMCommanding.aspx" target="_blank"&gt;ViewModel Commanding sample&lt;/a&gt; back in 2008 and posted it to CodeProject.&lt;/p&gt;  &lt;p&gt;It took me a little bit of review to understand the way it works, but the end result is a very clean and simple implementation that stays close to the original design intent behind WPF’s routed commands.&lt;/p&gt;  &lt;p&gt;Thanks Josh!&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/117.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/06/10/wpf-routedcommands-with-mvvm.aspx</guid>
            <pubDate>Thu, 10 Jun 2010 19:44:00 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/117.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/06/10/wpf-routedcommands-with-mvvm.aspx#feedback</comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/117.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/117.aspx</trackback:ping>
        </item>
        <item>
            <title>Stuff hitting my &amp;ldquo;Radar&amp;rdquo;</title>
            <category>Software Development</category>
            <category>alt.net</category>
            <link>http://blog.alner.net/archive/2010/06/10/stuff-hitting-my-radar.aspx</link>
            <description>&lt;p&gt;I recently started listening to the &lt;a href="http://herdingcode.com/" target="_blank"&gt;Herding Code podcast&lt;/a&gt; and &lt;a href="http://boagworld.com/" target="_blank"&gt;BoagWorld podcast&lt;/a&gt; and have subsequently been exposed to some really interesting “stuff”. I thought I’d put these down, if for no other reason than helping me remember to try them out.&lt;/p&gt;  &lt;h3&gt;JSConf&lt;/h3&gt;  &lt;p&gt;Javascript is getting a lot of attention and investment lately. This is both in the browser and on the server. There are a ton of cool things going on, many of which are discussed at &lt;a href="http://jsconf.us" target="_blank"&gt;JSConf&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;One of the trippy things I heard about is a JS library that will rip flash into HTML5 on the client, eliminating the need for the plug-in.&lt;/p&gt;  &lt;p&gt;The other thing they talked about was the security aspects around the web in general. All I can say is “unplug your internet connection now!” Also good justifications for having separate passwords (and usernames?) for each site.&lt;/p&gt;  &lt;h3&gt;Fluent Validation&lt;/h3&gt;  &lt;p&gt;The &lt;a href="http://fluentvalidation.codeplex.com" target="_blank"&gt;Fluent Validation&lt;/a&gt; library makes validation (and some business rules) almost a pleasure to write. I’ve used this with good results. Highly recommended!&lt;/p&gt;  &lt;h3&gt;Web Protection Library&lt;/h3&gt;  &lt;p&gt;I’ve heard of the Anti-XSS library, but I recently learned that MS released the successor to this in the form of the &lt;a href="http://wpl.codeplex.com/" target="_blank"&gt;Web Protection Library&lt;/a&gt;. The implementation is a bit different and the feature set is a bit wider than it’s predecessor. &lt;/p&gt;  &lt;h3&gt;RestSharp and Hammock&lt;/h3&gt;  &lt;p&gt;All the “cool kids” are doing REST. Those living in Microsoft land have some support for this via WCF, OData, etc. But it can still be a little tricky. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://restsharp.org/" target="_blank"&gt;RestSharp&lt;/a&gt; and &lt;a href="http://hammock.codeplex.com/" target="_blank"&gt;Hammock for REST&lt;/a&gt; are two open source projects that make it really simple to consume REST based services. I’ve tried both and ended up using Hammock. Very nice work by both projects!&lt;/p&gt;  &lt;h3&gt;Twilio&lt;/h3&gt;  &lt;p&gt;This is not a library. It’s a service. It took me a minute to get the vision, but I think it’s really cool…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.twilio.com/" target="_blank"&gt;Twilio&lt;/a&gt; is a REST API for “voice-enabling” your app and/or sending SMS messages. The voice part is cool because you can build a speech enabled “IVR” really easily.&lt;/p&gt;  &lt;h3&gt;NoSQL DBs&lt;/h3&gt;  &lt;p&gt;This is another thing that all the cool kids are doing… DBs without SQL. No, this is not the resurrection of Object Databases. Rather, this is the movement to “Document Databases”. &lt;/p&gt;  &lt;p&gt;A Document Database is one that stores a chunk of data as a single unit. In some ways, it’s kind of like storing a chunk of XML in a SQL Server XML column.&lt;/p&gt;  &lt;p&gt;The difference is that document databases often store the data using a JSON (or BSON) type format. They support many of the standard DB-ish features like indexes, queries, inserts, updates, LINQ, transactions, replication, backups, etc. They also enable some new features that are not simple in a relational model, like crazy fast performance, sharding, etc.&lt;/p&gt;  &lt;p&gt;I sort of wish that I would have known and considered these for a couple projects as they would have made certain scenarios much simpler and decreased the development time significantly.&lt;/p&gt;  &lt;p&gt;So far, I’ve looked into (but not yet used):&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.mongodb.org/" target="_blank"&gt;MongoDB&lt;/a&gt; is a fairly mature, open source, C++ based, cross platform, cross language implementation. It also has a commercial option.&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.ravendb.net/" target="_blank"&gt;RavenDB&lt;/a&gt; is an open source and/or commercial implementation that is tailored a bit more toward .NET. My investigation indicated that it has some features that management might like to see, such as ACID transaction, integration with .NET TransactionScopes, online backups, etc.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a href="http://www.michaelckennedy.net/" target="_blank"&gt;Michael C. Kennedy&lt;/a&gt; has a great series of &lt;a href="http://www.michaelckennedy.net/blog/" target="_blank"&gt;posts on NoSQL&lt;/a&gt;. &lt;/p&gt;  &lt;h3&gt;MVC Turbine&lt;/h3&gt;  &lt;p&gt;I’d heard of &lt;a href="http://mvcturbine.codeplex.com/" target="_blank"&gt;MVC Turbine&lt;/a&gt; a while back, but recently heard &lt;a href="http://herdingcode.com/?p=240" target="_blank"&gt;the interview on Herding Code&lt;/a&gt;, which helped me understand what it does and why it is.&lt;/p&gt;  &lt;p&gt;From what I understand, the key feature is it’s “glue” that lets you use an IoC container with MVC. Apparently, this is not simple to do on your own. With this in place, the framework can add some really nice features to an MVC app.&lt;/p&gt;  &lt;h3&gt;Fluent Migrator&lt;/h3&gt;  &lt;p&gt;Just heard about &lt;a href="http://github.com/schambers/fluentmigrator" target="_blank"&gt;Fluent Migrator&lt;/a&gt; one today. I’m intrigued by the concept of writing database migration steps in .NET such that they are DB agnostic and allow for easily moving a DB from one version to the next. This can be used in automated testing, automated deployments, and just getting a DB setup in the first place.&lt;/p&gt;  &lt;p&gt;I’m still a big fan of the VS DB projects and Red-Gate’s tools, but this seems like another nice tool to have in one’s toolbox. &lt;/p&gt;  &lt;h3&gt;Reactive Extensions&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx" target="_blank"&gt;RX for .NET and RX for JavaScript&lt;/a&gt; are two implementations of a pattern that make it simpler to “subscribe to events” and then do interesting filters or aggregations over multiple events and how those events relate to each other. There is a ton of info out there on these. Definitely worth a look. I hope to explore the applicability of these in a WPF app soon.&lt;/p&gt;  &lt;h3&gt;Clipperz&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://www.clipperz.com/" target="_blank"&gt;Clipperz&lt;/a&gt;is a “Web Rolodex for your passwords”. The cool thing is that they use client side, JavaScript based encryption technologies. They also follow a “Zero-Knowledge” approach and use the &lt;a href="http://en.wikipedia.org/wiki/Secure_Remote_Password_protocol" target="_blank"&gt;SRP protocol&lt;/a&gt;, meaning that the company itself has no way to decrypt the data that you store on their servers. Heady stuff, but very cool.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/116.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/06/10/stuff-hitting-my-radar.aspx</guid>
            <pubDate>Thu, 10 Jun 2010 14:18:29 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/116.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/06/10/stuff-hitting-my-radar.aspx#feedback</comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/116.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/116.aspx</trackback:ping>
        </item>
        <item>
            <title>WPF Style and Template Resources &amp;ndash; Order Matters</title>
            <category>WPF</category>
            <category>Software Development</category>
            <link>http://blog.alner.net/archive/2010/05/07/wpf-style-and-template-resources_order-matters.aspx</link>
            <description>&lt;p&gt;When working with WPF resources, remember to declare the resources in the correct order. &lt;/p&gt;  &lt;p&gt;A style or template that is referenced elsewhere must be defined before it can be used. In other words, if Style1 uses BrushA as a StaticResource, then BrushA must be defined before Style1. Otherwise, you’ll get fun errors like:&lt;/p&gt;  &lt;blockquote style="padding:10px;"&gt;   &lt;p&gt;&lt;em&gt;Unable to cast object of type 'MS.Internal.NamedObject' to type 'System.Windows.FrameworkTemplate'&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It may be common knowledge, but it can be a real pain to diagnose. This is especially true if you have a large set of template and styles for an application. It gets even more fun when you have multiple themes. &lt;/p&gt;  &lt;p&gt;Cheers.&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/113.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/05/07/wpf-style-and-template-resources_order-matters.aspx</guid>
            <pubDate>Fri, 07 May 2010 20:44:41 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/113.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/05/07/wpf-style-and-template-resources_order-matters.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/113.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/113.aspx</trackback:ping>
        </item>
        <item>
            <title>MVVM ViewModel Locator via WPF Converters</title>
            <category>Software Development</category>
            <category>WPF</category>
            <link>http://blog.alner.net/archive/2010/05/06/mvvm-viewmodel-locator-via-wpf-converters.aspx</link>
            <description>&lt;p&gt;&lt;a target="_blank" href="http://www.galasoft.ch/intro_en.html"&gt;Laurent Bugnion’s&lt;/a&gt; work on &lt;a target="_blank" href="http://www.galasoft.ch/mvvm/getstarted/"&gt;MVVM Light&lt;/a&gt; introduced me to the ViewModel Locator pattern. The concept and implementation are really slick! &lt;/p&gt;
&lt;p&gt;From my perspective, ViewModel Locators do the following:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Provide a simple, declarative way to connect a View to a ViewModel (duh). &lt;/li&gt;
    &lt;li&gt;Enable design-time support, including the ability to connect an alternate data source behind the VM (cool!). &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I want a solution that lets me: &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Connect my XAML views to their associated ViewModels &lt;/li&gt;
    &lt;li&gt;Handle a somewhat complex model with a hierarchy of domain model entities and collections. &lt;/li&gt;
    &lt;li&gt;Support “state” in the ViewModel and remember that state during the lifetime of the application. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After installing and attempting to use the MVVM Light implementation, I found that it wasn’t quite working the way I needed. After fumbling around a bit, doing some research, I stumbled on the idea of using a WPF converter (IValueConverter). &lt;/p&gt;
&lt;p&gt;I’ve put together a sample application which demonstrates this pattern and shows some of the scenarios that would otherwise be difficult to achieve. &lt;/p&gt;
&lt;p&gt;Here is a link to the source code for the demo:&lt;/p&gt;
&lt;div style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:0f9a3530-4ba6-4dc4-a6ec-5325ac120392" class="wlWriterEditableSmartContent"&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div&gt;&lt;a target="_self" href="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/MVVMViewModelLocatorviaWPFConverter_D34D/ViewModelLocatorsWithConverters_2010-05-05.zip"&gt;ViewModelLocatorsWithConverters_2010-05-05.zip&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;Demo Application – MVVM ViewModel Locators via IValueConverter Converters&lt;/h3&gt;
&lt;p&gt;Here you can see the initial state of the application. It has some inline text and a walkthrough scenario so that you can see the behavior of the app.&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/MVVMViewModelLocatorviaWPFConverter_D34D/image_2.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" width="743" height="349" src="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/MVVMViewModelLocatorviaWPFConverter_D34D/image_thumb.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Here you can see the app after walking though the usage steps. The inline text also highlights a couple key points to notice from the behavior.&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/MVVMViewModelLocatorviaWPFConverter_D34D/image_4.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" width="743" height="459" src="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/MVVMViewModelLocatorviaWPFConverter_D34D/image_thumb_1.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;h3&gt;Enough Chit-Chat. Code Please!&lt;/h3&gt;
&lt;p&gt;Let’s step back for just a moment and set some context. Laurent Bugnion’s VM Locators are design such that you create a special class in your application that can generate ViewModels as needed. This class is included as a resource in the app.xaml… &lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;vm&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ViewModelLocatorTemplate 
   &lt;/span&gt;&lt;span style="COLOR: red"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;vm&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="clr-namespace:ProjectForTemplate.ViewModel" 
   &lt;/span&gt;&lt;span style="COLOR: red"&gt;x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Locator" 
/&amp;gt;        

&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;… and then used in your code like this…&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DockPanel 
    &lt;/span&gt;&lt;span style="COLOR: red"&gt;DataContext&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;Source&lt;/span&gt;&lt;span style="COLOR: blue"&gt;={&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR: red"&gt;Locator&lt;/span&gt;&lt;span style="COLOR: blue"&gt;}, &lt;/span&gt;&lt;span style="COLOR: red"&gt;Path&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=ViewModelName}"
    &lt;/span&gt;&lt;span style="COLOR: red"&gt;LastChildFill&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="True"
&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The class itself has properties for each of the ViewModels that you need to use in your application. The logic behind these includes some great features that create sample data for design time support.&lt;/p&gt;
&lt;h3&gt;However…&lt;/h3&gt;
&lt;p&gt;… I ran into some issues when I tried to use this with a domain model that included a hierarchy of inter-related objects and collections of objects. I was unable to see how I could use a single class, with static properties to return multiple instances of a single type of ViewModel.&lt;/p&gt;
&lt;p&gt;I considered an approach that would pre-construct a hierarchy of ViewModels that matched the hierarchy of the domain model. Then I could simply pass that into my views and bind accordingly. However, at the suggestion of &lt;a target="_blank" href="http://rbroida.alner.net/"&gt;Richard Broida&lt;/a&gt;, I took the alternate approach of creating the ViewModels separately, on demand, and caching them. The end result feels right to me.&lt;/p&gt;
&lt;h3&gt;The XAML&lt;/h3&gt;
&lt;p&gt;Here is my code from my MainWindow of the sample app. As you can see, I have a hierarchy of domain model objects where a parent object might have multiple children in a collection.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Window &lt;/span&gt;&lt;span style="COLOR: red"&gt;x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Class&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="ViewModelLocatorsWithConverters.MainWindow"
        &lt;/span&gt;&lt;span style="COLOR: red"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        &lt;/span&gt;&lt;span style="COLOR: red"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"
        &lt;/span&gt;&lt;span style="COLOR: red"&gt;Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Converter ViewModel Locator Demo" 
        &lt;/span&gt;&lt;span style="COLOR: red"&gt;Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="600" &lt;/span&gt;&lt;span style="COLOR: red"&gt;Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="800" 
&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;

    &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- DataContext: MainViewModel --&amp;gt;
    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DockPanel 
&lt;strong&gt;        &lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: red"&gt;DataContext&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="{&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;Converter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;={&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR: red"&gt;MainVMLocator&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}}"
&lt;/strong&gt;        &lt;/span&gt;&lt;span style="COLOR: red"&gt;LastChildFill&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="True"
    &amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ScrollViewer &lt;/span&gt;&lt;span style="COLOR: red"&gt;VerticalScrollBarVisibility&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Auto" &lt;/span&gt;&lt;span style="COLOR: red"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Right"&amp;gt;
&lt;/span&gt;&lt;span style="COLOR: blue"&gt;             ...
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ScrollViewer&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StackPanel &lt;/span&gt;&lt;span style="COLOR: red"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Top"&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DockPanel &lt;/span&gt;&lt;span style="COLOR: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Stretch"&amp;gt;

                &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Label &lt;/span&gt;&lt;span style="COLOR: red"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="0" &lt;/span&gt;&lt;span style="COLOR: red"&gt;VerticalContentAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bottom" 
                       &lt;/span&gt;&lt;span style="COLOR: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bottom" &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;                       &lt;/span&gt;&lt;span style="COLOR: red"&gt;FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="16" &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;                       &lt;/span&gt;&lt;span style="COLOR: red"&gt;FontWeight&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bold"
                       &lt;/span&gt;&lt;span style="COLOR: red"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Left"
                &amp;gt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Families:&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Label&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;


                &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Button &lt;/span&gt;&lt;span style="COLOR: red"&gt;Command&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;LoadFamiliesCommand&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}&lt;/strong&gt;" &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;                        &lt;/span&gt;&lt;span style="COLOR: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Right" 
                        &lt;/span&gt;&lt;span style="COLOR: red"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="5" &lt;/span&gt;&lt;span style="COLOR: red"&gt;MinWidth&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="100"
                        &lt;/span&gt;&lt;span style="COLOR: red"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Right"
                &amp;gt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Load Families&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Button&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;

                &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Label &lt;/span&gt;&lt;span style="COLOR: red"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="0" &lt;/span&gt;&lt;span style="COLOR: red"&gt;VerticalContentAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bottom" &lt;/span&gt;&lt;span style="COLOR: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Right"
                       &lt;/span&gt;&lt;span style="COLOR: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bottom" &lt;/span&gt;&lt;span style="COLOR: red"&gt;FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="16" &lt;/span&gt;&lt;span style="COLOR: red"&gt;FontWeight&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bold" &lt;/span&gt;&lt;span style="COLOR: red"&gt;Foreground&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Green"
                       &lt;/span&gt;&lt;span style="COLOR: red"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Right"
                &amp;gt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Start Here -&amp;amp;gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Label&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;

            &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DockPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;            &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ComboBox 
                &lt;/span&gt;&lt;span style="COLOR: red"&gt;ItemsSource&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;Families&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}&lt;/strong&gt;" 
                &lt;/span&gt;&lt;span style="COLOR: red"&gt;DisplayMemberPath&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="FamilyName" 
                &lt;/span&gt;&lt;span style="COLOR: red"&gt;IsSynchronizedWithCurrentItem&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="True"
                &lt;/span&gt;&lt;span style="COLOR: red"&gt;SelectedItem&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;CurrentFamily&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}&lt;/strong&gt;" &lt;/span&gt;&lt;span style="COLOR: red"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="5"&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ComboBox&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;

        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- DataContext: FamilyViewModel --&amp;gt;
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DockPanel &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: #a31515"&gt;            &lt;/span&gt;&lt;span style="COLOR: red"&gt;DataContext&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;CurrentFamily&lt;/span&gt;&lt;span style="COLOR: blue"&gt;, &lt;/span&gt;&lt;span style="COLOR: red"&gt;Converter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;={&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR: red"&gt;FamilyVMLocator&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}}&lt;/strong&gt;" &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: red"&gt;            Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="0,10,0,0"&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DockPanel &lt;/span&gt;&lt;span style="COLOR: red"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Top" &lt;/span&gt;&lt;span style="COLOR: red"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="0"&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Label &lt;/span&gt;&lt;span style="COLOR: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bottom" &lt;/span&gt;&lt;span style="COLOR: red"&gt;VerticalContentAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bottom" &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;                       &lt;/span&gt;&lt;span style="COLOR: red"&gt;FontSize&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="16" &lt;/span&gt;&lt;span style="COLOR: red"&gt;FontWeight&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bold"&amp;gt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Family Members:&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Label&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Button 
                    &lt;/span&gt;&lt;span style="COLOR: red"&gt;Command&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;TogglePetsCommand&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}&lt;/strong&gt;" 
                    &lt;/span&gt;&lt;span style="COLOR: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Right"
                    &lt;/span&gt;&lt;span style="COLOR: red"&gt;Content&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;ShowPetsButtonText&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}&lt;/strong&gt;" &lt;/span&gt;&lt;span style="COLOR: red"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="5" &lt;/span&gt;&lt;span style="COLOR: red"&gt;MinWidth&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="100" /&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DockPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;

            &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox &lt;/span&gt;&lt;span style="COLOR: red"&gt;HorizontalContentAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Stretch"
                &lt;/span&gt;&lt;span style="COLOR: red"&gt;ItemsSource&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;Family&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;.Members}&lt;/strong&gt;" 
                &lt;/span&gt;&lt;span style="COLOR: red"&gt;SelectedItem&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;SelectedPerson&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}&lt;/strong&gt;" &lt;/span&gt;&lt;span style="COLOR: red"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="5"&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;

                        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- DataContext: PersonViewModel --&amp;gt;
                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: #a31515"&gt;                            &lt;/span&gt;&lt;span style="COLOR: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Stretch"
                            &lt;/span&gt;&lt;span style="COLOR: red"&gt;DataContext&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;Converter&lt;/span&gt;&lt;span style="COLOR: blue"&gt;={&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR: red"&gt;PersonVMLocator&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}}&lt;/strong&gt;" 
                        &amp;gt;
                            &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Border &lt;/span&gt;&lt;span style="COLOR: red"&gt;BorderThickness&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="2" &lt;/span&gt;&lt;span style="COLOR: red"&gt;BorderBrush&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Green" &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;                                    &lt;/span&gt;&lt;span style="COLOR: red"&gt;CornerRadius&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="4" &lt;/span&gt;&lt;span style="COLOR: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Stretch"&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;                                &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR: red"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="10, 2" &lt;/span&gt;&lt;span style="COLOR: red"&gt;MinWidth&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="200" &lt;/span&gt;&lt;span style="COLOR: red"&gt;FontFamily&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Verdana"&amp;gt;
                                    &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;FormattedName&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;}&lt;/strong&gt;" &lt;/span&gt;&lt;span style="COLOR: red"&gt;FontWeight&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Bold" /&amp;gt;
                                    &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;LineBreak&lt;/span&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;
                                    &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="  (" /&amp;gt;
                                    &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;Person&lt;/span&gt;&lt;/strong&gt;&lt;span style="COLOR: blue"&gt;&lt;strong&gt;.Role}&lt;/strong&gt;" /&amp;gt;
                                    &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=")" /&amp;gt;
                                &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;                            &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Border&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
                        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;

                    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;ListBox&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DockPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;

    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;DockPanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Window&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I’ve highlighted the bindings to help pull out the data that is rendered and the interaction with the ViewModel.&lt;/p&gt;
&lt;p&gt;Notice the three uses of a “Locator” such as:&lt;/p&gt;
&lt;p&gt;&lt;span style="COLOR: red"&gt;DataContext&lt;/span&gt; &lt;span style="COLOR: blue"&gt;="{&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="COLOR: red"&gt;Converter&lt;/span&gt; &lt;span style="COLOR: blue"&gt;={&lt;/span&gt; &lt;span style="COLOR: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR: red"&gt;MainVMLocator&lt;/span&gt; &lt;span style="COLOR: blue"&gt;}}"&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;These are references to the “Converter-Based ViewModel Locators”. They are pulled into that application via declarations in the app.xaml file as follows:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Application &lt;/span&gt;&lt;span style="COLOR: red"&gt;x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Class&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="ViewModelLocatorsWithConverters.App"
             &lt;/span&gt;&lt;span style="COLOR: red"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             &lt;/span&gt;&lt;span style="COLOR: red"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"
             &lt;/span&gt;&lt;span style="COLOR: red"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;l&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="clr-namespace:ViewModelLocatorsWithConverters.Locators"
             &lt;/span&gt;&lt;span style="COLOR: red"&gt;StartupUri&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="MainWindow.xaml"&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Application.Resources&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;

        &lt;/span&gt;&lt;span style="COLOR: green"&gt;&amp;lt;!-- 
        ********************************************************* 
        Declare VM Locators here for use throughout the application. 
        *********************************************************  
        --&amp;gt;
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;l&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;FamilyViewModelLocator &lt;/span&gt;&lt;span style="COLOR: red"&gt;x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="FamilyVMLocator" /&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;l&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;MainViewModelLocator &lt;/span&gt;&lt;span style="COLOR: red"&gt;x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="MainVMLocator" /&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;l&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;PersonViewModelLocator &lt;/span&gt;&lt;span style="COLOR: red"&gt;x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;Key&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="PersonVMLocator" /&amp;gt;
        
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Application.Resources&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #a31515"&gt;Application&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;There is one locator created for each ViewModel in the application. &lt;/p&gt;
&lt;h3&gt;Converter-Based Locators&lt;/h3&gt;
&lt;p&gt;So what does this converter based locator look like? The following class is one of three in the sample application. It’s job is to do the best it can to get a reference to the DomainModel using whatever was passed in as a parameter to the converter. Once it has a reference to the DomainModel instance, it can see if it already has a cached ViewModel, or it can create a new instance of the ViewModel.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;System;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;System.Windows.Data;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;ViewModelLocatorsWithConverters.Model;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;ViewModelLocatorsWithConverters.ViewModels;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;System.Globalization;

&lt;span style="COLOR: blue"&gt;namespace &lt;/span&gt;ViewModelLocatorsWithConverters.Locators
{
    &lt;span style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
    /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;Provides a method and a XAML IValueConverter to get the viewmodel 
    &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &lt;/span&gt;&lt;span style="COLOR: green"&gt;that is associated with the specified model or view model.
    &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public class &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;PersonViewModelLocator &lt;/span&gt;: &lt;span style="COLOR: #2b91af"&gt;IValueConverter
    &lt;/span&gt;{

        &lt;span style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;For the specified parameter, find or create an appropriate viewmodel.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="value"&amp;gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;An instance of a "parent" view model, 
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &lt;/span&gt;&lt;span style="COLOR: green"&gt;or an instance of the domain model class.&lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;/param&amp;gt;
        /// &amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;A new, or previously used view model instance.&lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;/returns&amp;gt;
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public static &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;PersonViewModel &lt;/span&gt;GetPersonViewModel(&lt;span style="COLOR: blue"&gt;object &lt;/span&gt;value)
        {
            &lt;span style="COLOR: green"&gt;// Check if we already have an instance of the viewmodel
            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;var &lt;/span&gt;vm = value &lt;span style="COLOR: blue"&gt;as &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;PersonViewModel&lt;/span&gt;;

            &lt;span style="COLOR: blue"&gt;if &lt;/span&gt;(&lt;span style="COLOR: blue"&gt;null &lt;/span&gt;== vm)
            {
                &lt;span style="COLOR: green"&gt;// The instance of the model that the ViewModel will handle.
                &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Person &lt;/span&gt;model = &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;;

                &lt;span style="COLOR: green"&gt;// See if the specified parameter is a known type.
                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;var &lt;/span&gt;Person = value &lt;span style="COLOR: blue"&gt;as &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Person&lt;/span&gt;;

                &lt;span style="COLOR: green"&gt;// Pull the desired domain model class from the parameter.
                &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if &lt;/span&gt;(&lt;span style="COLOR: #2b91af"&gt;ViewModelLocator&lt;/span&gt;.IsInDesignMode)
                    model = &lt;span style="COLOR: #2b91af"&gt;ViewModelLocator&lt;/span&gt;.InitDesignTimeInstance().Members[0];
                &lt;span style="COLOR: blue"&gt;else if &lt;/span&gt;(&lt;span style="COLOR: blue"&gt;null &lt;/span&gt;!= Person)
                    model = Person;
                &lt;span style="COLOR: blue"&gt;else
                    throw new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;ArgumentException&lt;/span&gt;(&lt;span style="COLOR: #a31515"&gt;"Value parameter must be an instance of a " &lt;/span&gt;+ 
                        &lt;span style="COLOR: #a31515"&gt;"Person or PersonViewModel. Specified value is of type " &lt;/span&gt;+ 
                        (&lt;span style="COLOR: blue"&gt;null &lt;/span&gt;== value ? &lt;span style="COLOR: #a31515"&gt;"&amp;lt;null&amp;gt;" &lt;/span&gt;: value.GetType().AssemblyQualifiedName), 
                        &lt;span style="COLOR: #a31515"&gt;"value"&lt;/span&gt;);

                &lt;span style="COLOR: green"&gt;// Get or create the ViewModel
                &lt;/span&gt;vm = &lt;span style="COLOR: #2b91af"&gt;ViewModelLocator&lt;/span&gt;.GetViewModel&amp;lt;&lt;span style="COLOR: #2b91af"&gt;PersonViewModel&lt;/span&gt;&amp;gt;(model);
                &lt;span style="COLOR: blue"&gt;if &lt;/span&gt;(&lt;span style="COLOR: blue"&gt;null &lt;/span&gt;== vm)
                {
                    vm = &lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;PersonViewModel&lt;/span&gt;(model);

                    &lt;span style="COLOR: green"&gt;// Save the VM in the cache. It will be used again if the same Person is shown again.
                    &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;ViewModelLocator&lt;/span&gt;.CacheViewModel(model, vm);
                }
            }

            &lt;span style="COLOR: blue"&gt;return &lt;/span&gt;vm;
        }


        &lt;span style="COLOR: blue"&gt;public object &lt;/span&gt;Convert(&lt;span style="COLOR: blue"&gt;object &lt;/span&gt;value, &lt;span style="COLOR: #2b91af"&gt;Type &lt;/span&gt;targetType, &lt;span style="COLOR: blue"&gt;object &lt;/span&gt;parameter, &lt;span style="COLOR: #2b91af"&gt;CultureInfo &lt;/span&gt;culture)
        {
            &lt;span style="COLOR: blue"&gt;return &lt;/span&gt;GetPersonViewModel(value);
        }

        &lt;span style="COLOR: blue"&gt;public object &lt;/span&gt;ConvertBack(&lt;span style="COLOR: blue"&gt;object &lt;/span&gt;value, &lt;span style="COLOR: #2b91af"&gt;Type &lt;/span&gt;targetType, &lt;span style="COLOR: blue"&gt;object &lt;/span&gt;parameter, &lt;span style="COLOR: #2b91af"&gt;CultureInfo &lt;/span&gt;culture)
        {
            &lt;span style="COLOR: blue"&gt;throw new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;NotImplementedException&lt;/span&gt;();
        }
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3&gt;The ViewModel Cache&lt;/h3&gt;
&lt;p&gt;A single ViewModelLocator helper class stores the cache of ViewModels. This cache is keyed by the DomainModel instance. Here is the relevant code:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;System;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;System.Collections.Generic;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;System.ComponentModel;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;System.Diagnostics;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;System.Windows;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;ViewModelLocatorsWithConverters.Model;
&lt;span style="COLOR: blue"&gt;using &lt;/span&gt;ViewModelLocatorsWithConverters.ViewModels;

&lt;span style="COLOR: blue"&gt;namespace &lt;/span&gt;ViewModelLocatorsWithConverters.Locators
{

    &lt;span style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
    /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;Stores a cache of view model instances. Also detects design time mode.
    &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
    /// &amp;lt;remarks&amp;gt;
    /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;This is an internal class for use by the ViewModelLocator classes.
    &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &lt;/span&gt;&lt;span style="COLOR: green"&gt;Portions of this implementation are based on work by Laurent Bugnion (Galasoft).
    &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/remarks&amp;gt;
    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public static class &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;ViewModelLocator
    &lt;/span&gt;{

        &lt;span style="COLOR: blue"&gt;#region &lt;/span&gt;Member Variables

        &lt;span style="COLOR: green"&gt;// Store a list of ViewModel instances, keyed by their associated model instance.
        // Key is a composite of the related instance plus the type of viewmodel. 
        // This is because a given instance could have multiple views.
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private static &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt;&amp;gt;, &lt;span style="COLOR: #2b91af"&gt;ViewModelBase&lt;/span&gt;&amp;gt; _ViewModelCache 
            = &lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="COLOR: #2b91af"&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt;&amp;gt;, &lt;span style="COLOR: #2b91af"&gt;ViewModelBase&lt;/span&gt;&amp;gt;();

        &lt;span style="COLOR: green"&gt;// Flag indicating whether the view is loaded in the designer.
        // Access via the property getter.
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private static bool&lt;/span&gt;? _isInDesignMode;

        &lt;span style="COLOR: blue"&gt;#endregion

        #region &lt;/span&gt;Constructors

        &lt;span style="COLOR: blue"&gt;#endregion

        #region &lt;/span&gt;Public Methods


        &lt;span style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;Gets a value indicating whether the control is in design mode
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &lt;/span&gt;&lt;span style="COLOR: green"&gt;(running in Blend or Visual Studio).
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public static bool &lt;/span&gt;IsInDesignMode
        {
            &lt;span style="COLOR: blue"&gt;get
            &lt;/span&gt;{
                &lt;span style="COLOR: blue"&gt;if &lt;/span&gt;(!_isInDesignMode.HasValue)
                {
&lt;span style="COLOR: blue"&gt;#if &lt;/span&gt;SILVERLIGHT
                    &lt;span style="COLOR: gray"&gt;_isInDesignMode = DesignerProperties.IsInDesignTool;
&lt;/span&gt;&lt;span style="COLOR: blue"&gt;#else
                    var &lt;/span&gt;prop = &lt;span style="COLOR: #2b91af"&gt;DesignerProperties&lt;/span&gt;.IsInDesignModeProperty;
                    _isInDesignMode
                        = (&lt;span style="COLOR: blue"&gt;bool&lt;/span&gt;)&lt;span style="COLOR: #2b91af"&gt;DependencyPropertyDescriptor
                        &lt;/span&gt;.FromProperty(prop, &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(&lt;span style="COLOR: #2b91af"&gt;FrameworkElement&lt;/span&gt;))
                        .Metadata.DefaultValue;

                    &lt;span style="COLOR: green"&gt;// Just to be sure
                    &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if &lt;/span&gt;(!_isInDesignMode.Value
                        &amp;amp;&amp;amp; &lt;span style="COLOR: #2b91af"&gt;Process&lt;/span&gt;.GetCurrentProcess().ProcessName.StartsWith(&lt;span style="COLOR: #a31515"&gt;"devenv"&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;StringComparison&lt;/span&gt;.Ordinal))
                    {
                        _isInDesignMode = &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;;
                    }
&lt;span style="COLOR: blue"&gt;#endif
                &lt;/span&gt;}

                &lt;span style="COLOR: blue"&gt;return &lt;/span&gt;_isInDesignMode.Value;
            }
        }


        &lt;span style="COLOR: blue"&gt;#endregion

        #region &lt;/span&gt;Internal Methods

        &lt;span style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;Get a previously cached ViewModel from the cache.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        /// &amp;lt;typeparam name="T"&amp;gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;The type of the ViewModel instance.&lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;/typeparam&amp;gt;
        /// &amp;lt;param name="model"&amp;gt;
        /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;A reference to the instance of the model that is related to this ViewModel instance.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &lt;/span&gt;&lt;span style="COLOR: green"&gt;This can be null if there is no model, as is often the case for the "main" or "root" ViewModel.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/param&amp;gt;
        /// &amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;The cached ViewModel, or null if none is found.&lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;/returns&amp;gt;
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;internal static &lt;/span&gt;T GetViewModel&amp;lt;T&amp;gt;(&lt;span style="COLOR: blue"&gt;object &lt;/span&gt;model) &lt;span style="COLOR: blue"&gt;where &lt;/span&gt;T : &lt;span style="COLOR: #2b91af"&gt;ViewModelBase
        &lt;/span&gt;{
            &lt;span style="COLOR: blue"&gt;var &lt;/span&gt;key = &lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt;&amp;gt;(model, &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(T));
            &lt;span style="COLOR: blue"&gt;if &lt;/span&gt;(_ViewModelCache.ContainsKey(key))
                &lt;span style="COLOR: blue"&gt;return &lt;/span&gt;_ViewModelCache[key] &lt;span style="COLOR: blue"&gt;as &lt;/span&gt;T;
            &lt;span style="COLOR: blue"&gt;else
                return null&lt;/span&gt;;
        }

        &lt;span style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;Cache a ViewModel so that it can be used again if/when the domain model is
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &lt;/span&gt;&lt;span style="COLOR: green"&gt;displayed again.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        /// &amp;lt;param name="model"&amp;gt;
        /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;A reference to the instance of the model that is related to this ViewModel instance.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &lt;/span&gt;&lt;span style="COLOR: green"&gt;This can be null if there is no model, as is often the case for the "main" or "root" ViewModel.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/param&amp;gt;
        /// &amp;lt;param name="viewModel"&amp;gt;
        /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;The instance of the ViewModel to cache.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/param&amp;gt;
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;internal static void &lt;/span&gt;CacheViewModel(&lt;span style="COLOR: blue"&gt;object &lt;/span&gt;model, &lt;span style="COLOR: #2b91af"&gt;ViewModelBase &lt;/span&gt;viewModel)
        {
            &lt;span style="COLOR: blue"&gt;var &lt;/span&gt;key = &lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt;&amp;gt;(model, viewModel.GetType());
            _ViewModelCache.Add(key, viewModel);
        }

        &lt;span style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;Remove a ViewModel from the cache.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        /// &amp;lt;typeparam name="T"&amp;gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;The type of the ViewModel to clear.&lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;/typeparam&amp;gt;
        /// &amp;lt;param name="model"&amp;gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;The instance of the model that this ViewModel was linked to. This can be null.&lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;/param&amp;gt;
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;internal static void &lt;/span&gt;ClearViewModel&amp;lt;T&amp;gt;(&lt;span style="COLOR: blue"&gt;object &lt;/span&gt;model) &lt;span style="COLOR: blue"&gt;where &lt;/span&gt;T : &lt;span style="COLOR: #2b91af"&gt;ViewModelBase
        &lt;/span&gt;{
            &lt;span style="COLOR: blue"&gt;var &lt;/span&gt;key = &lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style="COLOR: blue"&gt;object&lt;/span&gt;, &lt;span style="COLOR: #2b91af"&gt;Type&lt;/span&gt;&amp;gt;(model, &lt;span style="COLOR: blue"&gt;typeof&lt;/span&gt;(T));
            &lt;span style="COLOR: #2b91af"&gt;ViewModelBase &lt;/span&gt;vm = &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;;

            &lt;span style="COLOR: blue"&gt;if &lt;/span&gt;(_ViewModelCache.ContainsKey(key))
                vm = _ViewModelCache[key];

            &lt;span style="COLOR: blue"&gt;if &lt;/span&gt;(vm != &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;)
            {
                _ViewModelCache.Remove(key);
            }
        }

        &lt;span style="COLOR: blue"&gt;#endregion

        #region &lt;/span&gt;Designer Data Helpers

        &lt;span style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="COLOR: green"&gt;Create some instances of the domain model for use during design time.
        &lt;/span&gt;&lt;span style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;internal static &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Family &lt;/span&gt;InitDesignTimeInstance()
        {
            &lt;span style="COLOR: #2b91af"&gt;Family &lt;/span&gt;family = &lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Family&lt;/span&gt;() { 
                FamilyName = &lt;span style="COLOR: #a31515"&gt;"Design Time Family" 
            &lt;/span&gt;};

            family.Members.Add(&lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Person&lt;/span&gt;()
            {
                Name = &lt;span style="COLOR: #a31515"&gt;"John Doe"&lt;/span&gt;,
                Role = &lt;span style="COLOR: #a31515"&gt;"Father"
            &lt;/span&gt;});

            family.Members.Add(&lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Person&lt;/span&gt;()
            {
                Name = &lt;span style="COLOR: #a31515"&gt;"Jane Doe"&lt;/span&gt;,
                Role = &lt;span style="COLOR: #a31515"&gt;"Mother"
            &lt;/span&gt;});

            family.Members.Add(&lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Person&lt;/span&gt;()
            {
                Name = &lt;span style="COLOR: #a31515"&gt;"Jimmy Doe"&lt;/span&gt;,
                Role = &lt;span style="COLOR: #a31515"&gt;"Child"
            &lt;/span&gt;});

            family.Members.Add(&lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Person&lt;/span&gt;()
            {
                Name = &lt;span style="COLOR: #a31515"&gt;"Jill Doe"&lt;/span&gt;,
                Role = &lt;span style="COLOR: #a31515"&gt;"Child"
            &lt;/span&gt;});

            family.Members.Add(&lt;span style="COLOR: blue"&gt;new &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Person&lt;/span&gt;()
            {
                Name = &lt;span style="COLOR: #a31515"&gt;"Spot"&lt;/span&gt;,
                Role = &lt;span style="COLOR: #a31515"&gt;"Dog"
            &lt;/span&gt;});
            
            &lt;span style="COLOR: blue"&gt;return &lt;/span&gt;family;
        }

        &lt;span style="COLOR: blue"&gt;#endregion

    &lt;/span&gt;}
}&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This class is based on the work of Laurent Bugnion in his MVVM Light implantation. I’ve added supporting methods for caching and retrieving ViewModel instances.&lt;/p&gt;
&lt;h3&gt;Benefits and Shortcomings &lt;/h3&gt;
&lt;p&gt;The above approach really shines in a couple scenarios:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Bound collections&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you have a collection of domain model objects that you want to bind into the view, you could simply bind that collection directly. That works for simple cases. &lt;/p&gt;
&lt;p&gt;What if you have a need to do some formatting, add some commands, do some additional lookups, etc? That’s what ViewModels are for, right? But how do I inject a ViewModel between the collection and the ItemsControl / ListBox / etc.? You could do something like I’ve mentioned in a previous post using Bindable Linq, Continuous Linq, Obtics, or even the new Linq library from ComponentOne. That has it’s benefits, but might not be an option.&lt;/p&gt;
&lt;p&gt;The MVVM Light locator doesn’t seem to help here because I only get a single instance of the ViewModel from the Locator, and it isn’t “hooked up” to the instance of the domain model that’s in my collection.&lt;/p&gt;
&lt;p&gt;So…&lt;/p&gt;
&lt;p&gt;Using a converter, I can &lt;strong&gt;“inject” a ViewModel during the binding&lt;/strong&gt; operation such that the items in my ItemsControl / ListBox / whatever are now bound to an instance of a ViewModel. &lt;/p&gt;
&lt;p&gt;On top of that, &lt;strong&gt;the ViewModel is “married” to the instance of the domain model &lt;/strong&gt;so that I can have &lt;strong&gt;item-specific view related state&lt;/strong&gt;. This state might include things like filter options, positions, sizes, item visibility, etc. This information might not have a durable storage location, but it’s not something that should be lost just because I went to another tab / page / item / view in my application.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Composable UIs&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are some cases, where you might create a user control that is shown from many locations in the application. This user control needs to get a reference to the ViewModel on which it depends. How does one do this?&lt;/p&gt;
&lt;p&gt;You could set the DataContext in each location that you use the control, but…&lt;/p&gt;
&lt;p&gt;A Converter-based locator provides some nice benefits in that &lt;strong&gt;the user control can figure it out for itself&lt;/strong&gt;. The locator takes in the “&lt;em&gt;ambient DataContext&lt;/em&gt;” based on where it is hosted in the UI. This ambient context could be another ViewModel, another DomainModel, the actual ViewModel used by the control, or the actual DomainModel used by the control.&lt;/p&gt;
&lt;p&gt;In any of the above cases, the locator simply inspects the instance passed to the converter and reacts accordingly. In the case of a “parent” ViewModel, the converter might be able to use a property on that ViewModel to get a reference to the instance needed by the UserControl. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Design-Time Support&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As with MVVM Light, the above implementation enables design-time support, making the solution “Blend-able”. You can see in the screen shot below that the drop down has some design time data in it. You can also see that the ListBox has items in it based on the data that I created in my ViewModelLocator when it detected design time.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/MVVMViewModelLocatorviaWPFConverter_D34D/image_6.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="Design time support in VS 2010" border="0" alt="Design time support in VS 2010" width="644" height="389" src="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/MVVMViewModelLocatorviaWPFConverter_D34D/image_thumb_2.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Shortcomings&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are some known issues in the current version. The main item is the fact that the cache holds a strong reference to the ViewModel and the DomainModel objects. This can be overcome with the use of WeakReferences and the WeakEventManager. I hope to address this soon.&lt;/p&gt;
&lt;p&gt;Related to this is the question of “closing” or cleaning up an instance. This is something that I also hope to address soon. I haven’t had a strong need to dispose of ViewModels or DomainModels yet, but I know that it is an important scenario.&lt;/p&gt;
&lt;h3&gt;Call to Action&lt;/h3&gt;
&lt;p&gt;&lt;u&gt;Please let me know what you think.&lt;/u&gt; &lt;/p&gt;
&lt;p&gt;Maybe I missed some simple concept with MVVM Light that would make all of this unnecessary. Maybe there are other implementations that do this pattern already. Maybe you see a major flaw in the approach.&lt;/p&gt;
&lt;p&gt;… Or maybe this is useful.&lt;/p&gt;
&lt;p&gt;I’m hoping for useful ;-] &lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;P.S. In case you missed it, the link to the source code for the demo is included at the top of this post.&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/112.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/05/06/mvvm-viewmodel-locator-via-wpf-converters.aspx</guid>
            <pubDate>Thu, 06 May 2010 04:05:23 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/112.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/05/06/mvvm-viewmodel-locator-via-wpf-converters.aspx#feedback</comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/112.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/112.aspx</trackback:ping>
        </item>
        <item>
            <title>Cancelling Selection Change in a Bound WPF Combo Box</title>
            <category>WPF</category>
            <category>Software Development</category>
            <link>http://blog.alner.net/archive/2010/04/25/cancelling-selection-change-in-a-bound-wpf-combo-box.aspx</link>
            <description>&lt;h3&gt;Scenario &lt;/h3&gt;  &lt;p&gt;A user selects a new value from a WPF combo box. You ask if they are sure they want to do this. User says “No”.&lt;/p&gt;  &lt;p&gt;WPF app is built with MVVM such that the combo box’s SelectedItem is bound to a property on the ViewModel. In the setter, you prompt the user and attempt to cancel the selection by discarding the new selected value.&lt;/p&gt;  &lt;p&gt;Here’s the UI XAML&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Window &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Class&lt;/span&gt;&lt;span style="color: blue"&gt;="WpfComboBoxCancelSelect.MainWindow"
        &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"
        &lt;/span&gt;&lt;span style="color: red"&gt;Title&lt;/span&gt;&lt;span style="color: blue"&gt;="Cancellable Combo Box Demo" &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;="158" &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;="242"
&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Normal - This doesn't work&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ComboBox 
                &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;="Left" 
                &lt;/span&gt;&lt;span style="color: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;="Top"
                &lt;/span&gt;&lt;span style="color: red"&gt;ItemsSource&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;People&lt;/span&gt;&lt;span style="color: blue"&gt;}"
                &lt;/span&gt;&lt;span style="color: red"&gt;SelectedItem&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;CurrentPerson&lt;/span&gt;&lt;span style="color: blue"&gt;, &lt;/span&gt;&lt;span style="color: red"&gt;Mode&lt;/span&gt;&lt;span style="color: blue"&gt;=TwoWay}"
                &lt;/span&gt;&lt;span style="color: red"&gt;DisplayMemberPath&lt;/span&gt;&lt;span style="color: blue"&gt;="Name"
            /&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Cancellable Combo - This works.&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Label&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ComboBox 
                &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;="Left" 
                &lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;="comboBox2" 
                &lt;/span&gt;&lt;span style="color: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;="Top"
                &lt;/span&gt;&lt;span style="color: red"&gt;ItemsSource&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;People&lt;/span&gt;&lt;span style="color: blue"&gt;}"
                &lt;/span&gt;&lt;span style="color: red"&gt;SelectedItem&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;CurrentPersonCancellable&lt;/span&gt;&lt;span style="color: blue"&gt;, &lt;/span&gt;&lt;span style="color: red"&gt;Mode&lt;/span&gt;&lt;span style="color: blue"&gt;=TwoWay}"
                &lt;/span&gt;&lt;span style="color: red"&gt;DisplayMemberPath&lt;/span&gt;&lt;span style="color: blue"&gt;="Name"
            /&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Window&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;

&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Here are screen shots of my sample UI&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/CancellingselectionchangeinWPFcombobox_E961/image_2.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/CancellingselectionchangeinWPFcombobox_E961/image_thumb.png" width="244" height="161" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/CancellingselectionchangeinWPFcombobox_E961/image_4.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/CancellingselectionchangeinWPFcombobox_E961/image_thumb_1.png" width="244" height="169" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;Attempt #1 - The way you’d think it would work&lt;/h3&gt;

&lt;p&gt;You’d think that you could do something like this:&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;_CurrentPerson;
&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;CurrentPerson
{
    &lt;span style="color: blue"&gt;get
    &lt;/span&gt;{
        &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Getting CurrentPerson."&lt;/span&gt;);
        &lt;span style="color: blue"&gt;return &lt;/span&gt;_CurrentPerson;
    }
    &lt;span style="color: blue"&gt;set
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: blue"&gt;value &lt;/span&gt;== _CurrentPerson)
            &lt;span style="color: blue"&gt;return&lt;/span&gt;;

        &lt;span style="color: blue"&gt;if &lt;/span&gt;(
            &lt;span style="color: #2b91af"&gt;MessageBox&lt;/span&gt;.Show(
                &lt;span style="color: #a31515"&gt;"Allow change of selected item?"&lt;/span&gt;, 
                &lt;span style="color: #a31515"&gt;"Continue"&lt;/span&gt;, 
                &lt;span style="color: #2b91af"&gt;MessageBoxButton&lt;/span&gt;.YesNo
            ) != &lt;span style="color: #2b91af"&gt;MessageBoxResult&lt;/span&gt;.Yes
        )
        {
            &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Selection Cancelled."&lt;/span&gt;);

            &lt;span style="color: green"&gt;// You would think this should work, but it doesn't.
            // This is called within the same binding "context" 
            //  as that of the original setter.
            // The value needs to be changed back in a subsequent setter.
            &lt;/span&gt;OnPropertyChanged(&lt;span style="color: #a31515"&gt;"CurrentPerson"&lt;/span&gt;);
            &lt;span style="color: blue"&gt;return&lt;/span&gt;;
        }

        &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Selection applied."&lt;/span&gt;);
        _CurrentPerson = &lt;span style="color: blue"&gt;value&lt;/span&gt;;
        OnPropertyChanged(&lt;span style="color: #a31515"&gt;"CurrentPerson"&lt;/span&gt;);
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This doesn’t work. The ViewModel will have the values that you desire, but the UI will look like it applied the changes.&lt;/p&gt;

&lt;h3&gt;Attempt #2 – BeginInvoke() the PropertyChanged event&lt;/h3&gt;

&lt;p&gt;Based on info from &lt;a href="http://stackoverflow.com/questions/2585183/wpf-combobox-selecteditem-change-to-previous-value" target="_blank"&gt;this Stack Overflow question&lt;/a&gt;, I tried the following. This still didn’t work for me. (Note that I’m working with WPF 4.0 RTM).&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;_CurrentPersonTry2;
&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;CurrentPersonTry2
{
    &lt;span style="color: blue"&gt;get
    &lt;/span&gt;{
        &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Getting CurrentPersonTry2."&lt;/span&gt;);
        &lt;span style="color: blue"&gt;return &lt;/span&gt;_CurrentPersonTry2;
    }
    &lt;span style="color: blue"&gt;set
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: blue"&gt;value &lt;/span&gt;== _CurrentPersonTry2)
            &lt;span style="color: blue"&gt;return&lt;/span&gt;;

        &lt;span style="color: blue"&gt;if &lt;/span&gt;(
            &lt;span style="color: #2b91af"&gt;MessageBox&lt;/span&gt;.Show(
                &lt;span style="color: #a31515"&gt;"Allow change of selected item?"&lt;/span&gt;,
                &lt;span style="color: #a31515"&gt;"Continue"&lt;/span&gt;,
                &lt;span style="color: #2b91af"&gt;MessageBoxButton&lt;/span&gt;.YesNo
            ) != &lt;span style="color: #2b91af"&gt;MessageBoxResult&lt;/span&gt;.Yes
        )
        {
            &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Selection Cancelled."&lt;/span&gt;);

            &lt;span style="color: green"&gt;// Tell the UI that it should re-bind the value.
            // Do this after the UI has finished it's 
            // current context operation.
            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Application&lt;/span&gt;.Current.Dispatcher.BeginInvoke(
                    &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;(() =&amp;gt;
                    {
                        &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(
                            &lt;span style="color: #a31515"&gt;"Dispatcher BeginInvoke " &lt;/span&gt;+
                            &lt;span style="color: #a31515"&gt;"Setting CurrentPersonTry2."
                        &lt;/span&gt;);

                        OnPropertyChanged(&lt;span style="color: #a31515"&gt;"CurrentPersonTry2"&lt;/span&gt;);
                    }),
                    &lt;span style="color: #2b91af"&gt;DispatcherPriority&lt;/span&gt;.ContextIdle,
                    &lt;span style="color: blue"&gt;null
                &lt;/span&gt;);

            &lt;span style="color: blue"&gt;return&lt;/span&gt;;
        }

        &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Selection applied."&lt;/span&gt;);
        _CurrentPersonTry2 = &lt;span style="color: blue"&gt;value&lt;/span&gt;;
        OnPropertyChanged(&lt;span style="color: #a31515"&gt;"CurrentPersonTry2"&lt;/span&gt;);
    }
}&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above code works just like the first version.&lt;/p&gt;

&lt;h3&gt;Attempt #3 – The final solution&lt;/h3&gt;

&lt;p&gt;On a whim, I figured I’d try another tweak. I tried letting the underlying value appear to change so that I could change it back to the original value on a BeginInvoke operation. For whatever reason, this does work.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;_CurrentPersonCancellable;
&lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;CurrentPersonCancellable
{
    &lt;span style="color: blue"&gt;get
    &lt;/span&gt;{
        &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Getting CurrentPersonCancellable."&lt;/span&gt;);
        &lt;span style="color: blue"&gt;return &lt;/span&gt;_CurrentPersonCancellable;
    }
    &lt;span style="color: blue"&gt;set
    &lt;/span&gt;{
        &lt;span style="color: green"&gt;// Store the current value so that we can 
        // change it back if needed.
        &lt;/span&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;origValue = _CurrentPersonCancellable;

        &lt;span style="color: green"&gt;// If the value hasn't changed, don't do anything.
        &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: blue"&gt;value &lt;/span&gt;== _CurrentPersonCancellable)
            &lt;span style="color: blue"&gt;return&lt;/span&gt;;

        &lt;span style="color: green"&gt;// Note that we actually change the value for now.
        // This is necessary because WPF seems to query the 
        //  value after the change. The combo box
        // likes to know that the value did change.
        &lt;/span&gt;_CurrentPersonCancellable = &lt;span style="color: blue"&gt;value&lt;/span&gt;;

        &lt;span style="color: blue"&gt;if &lt;/span&gt;(
            &lt;span style="color: #2b91af"&gt;MessageBox&lt;/span&gt;.Show(
                &lt;span style="color: #a31515"&gt;"Allow change of selected item?"&lt;/span&gt;, 
                &lt;span style="color: #a31515"&gt;"Continue"&lt;/span&gt;, 
                &lt;span style="color: #2b91af"&gt;MessageBoxButton&lt;/span&gt;.YesNo
            ) != &lt;span style="color: #2b91af"&gt;MessageBoxResult&lt;/span&gt;.Yes
        )
        {
            &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Selection Cancelled."&lt;/span&gt;);

            &lt;span style="color: green"&gt;// change the value back, but do so after the 
            // UI has finished it's current context operation.
            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Application&lt;/span&gt;.Current.Dispatcher.BeginInvoke(
                    &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;(() =&amp;gt;
                    {
                        &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(
                            &lt;span style="color: #a31515"&gt;"Dispatcher BeginInvoke " &lt;/span&gt;+ 
                            &lt;span style="color: #a31515"&gt;"Setting CurrentPersonCancellable."
                        &lt;/span&gt;);

                        &lt;span style="color: green"&gt;// Do this against the underlying value so 
                        //  that we don't invoke the cancellation question again.
                        &lt;/span&gt;_CurrentPersonCancellable = origValue;
                        OnPropertyChanged(&lt;span style="color: #a31515"&gt;"CurrentPersonCancellable"&lt;/span&gt;);
                    }),
                    &lt;span style="color: #2b91af"&gt;DispatcherPriority&lt;/span&gt;.ContextIdle,
                    &lt;span style="color: blue"&gt;null
                &lt;/span&gt;);

            &lt;span style="color: green"&gt;// Exit early. 
            &lt;/span&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt;;
        }

        &lt;span style="color: green"&gt;// Normal path. Selection applied. 
        // Raise PropertyChanged on the field.
        &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Selection applied."&lt;/span&gt;);
        OnPropertyChanged(&lt;span style="color: #a31515"&gt;"CurrentPersonCancellable"&lt;/span&gt;);
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The important change was to &lt;em&gt;Actually change the underlying value and then change it back&lt;/em&gt;. It was also important to run this “undo” on a separate dispatcher operation.&lt;/p&gt;

&lt;h3&gt;Closing Thoughts&lt;/h3&gt;

&lt;p&gt;I’ve attached the sample solution if you want to see this in action.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:1790c148-75b8-446d-8fda-c7c7b8a7cb9e" class="wlWriterEditableSmartContent"&gt;&lt;p /&gt;&lt;div&gt;&lt;a href="http://blog.alner.net/images/blog_alner_net/WindowsLiveWriter/CancellingselectionchangeinWPFcombobox_E961/WpfComboBoxCancelSelect.zip" target="_self"&gt;WpfComboBoxCancelSelect.zip&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;I’m not sure what I think about this overall. It sort of makes sense once you get it working, but this is definitely not intuitive. I would think that simply raising PropertyChanged would tell WPF that to re-query the value. It should detect this and undo the change in the combo box. Doing this on a separate Dispatcher operation is tolerable, but having to make it look like the value actually took and then undoing it seems like it crosses the line of sanity.&lt;/p&gt;

&lt;p&gt;Hopefully someone can show me a better way. For now, this works.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/111.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/04/25/cancelling-selection-change-in-a-bound-wpf-combo-box.aspx</guid>
            <pubDate>Sun, 25 Apr 2010 20:38:00 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/111.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/04/25/cancelling-selection-change-in-a-bound-wpf-combo-box.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/111.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/111.aspx</trackback:ping>
        </item>
        <item>
            <title>I &amp;lt;3 LinqKit &amp;ndash; Dynamically build arbitrarily complex Linq Queries</title>
            <category>Entity Framework</category>
            <category>Software Development</category>
            <category>Fundamentals</category>
            <category>Linq</category>
            <link>http://blog.alner.net/archive/2010/04/14/i_love_linqkit_for_arbitrarily_complex_linq_queries.aspx</link>
            <description>&lt;p&gt;In some cases, I need to be able to build a query that has a variable set of &lt;em&gt;OR conditions&lt;/em&gt;. This is &lt;em&gt;not simple &lt;/em&gt;with the default language constructs and extension methods. &lt;/p&gt;
&lt;p&gt;It’s simple to dynamically build an expression that includes AND parameters, because that is what the WHERE() extension method does. Not so easy for OR’ing together a bunch of conditions.&lt;/p&gt;
&lt;p&gt;Enter &lt;a target="_blank" href="http://www.albahari.com/nutshell/predicatebuilder.aspx"&gt;LinqKit&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is a great library. It provides some easy to use (but powerful) extension methods that let you “Or()” some conditions together. A common case is where you get a list of values that you need to add into the condition. You iterate over these and append them to an expression in a foreach() loop. Check out the LinqKit page for some great samples and explanations. I’d share some of my stuff, but their page is already awesome.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/106.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/04/14/i_love_linqkit_for_arbitrarily_complex_linq_queries.aspx</guid>
            <pubDate>Wed, 14 Apr 2010 15:42:00 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/106.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/04/14/i_love_linqkit_for_arbitrarily_complex_linq_queries.aspx#feedback</comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/106.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/106.aspx</trackback:ping>
        </item>
        <item>
            <title>Entity Framework 4.0 doesn&amp;rsquo;t enforce MaxLength metadata</title>
            <category>Software Development</category>
            <category>Entity Framework</category>
            <link>http://blog.alner.net/archive/2010/04/13/entity_framework_does_not_enforce_maxlength_metadata.aspx</link>
            <description>&lt;p&gt;I’m a little flabbergasted that Entity Framework does not do anything to enforce the MaxLength on string values. It just passes this responsibility down to the database and catches the resulting (unhelpful) exceptions. &lt;/p&gt;  &lt;p&gt;I suppose that there is a justification for this, but from an notably simplistic perspective… Why should I start a transaction and waste precious DB resources, only to get some generic “String or binary data may be truncated” error message back. It would be trivial for EF to use the metadata to ensure that you cannot push a 10 character string into a field that only holds 5.&lt;/p&gt;  &lt;p&gt;I’ll grant you that I may want to allow the domain model to store this data temporarily, since it is an acceptable use case to allow a domain model to be in an invalid state during some part of it’s “in-memory” life-cycle. But databases don’t follow this same forgiving behavior. They’re stubborn and just refuse the data with a vague message.&lt;/p&gt;  &lt;p&gt;It seems like EF should have a check that it does on the data, prior to committing it, that returns a helpful exception message if some of the data violates the EF model’s constraints. It could even go so far as to tell you which field on which object has a disreputable value.&lt;/p&gt;  &lt;p&gt;I know that I can implement this by altering the T4 templates, and this is a huge improvement over past options (I love T4!). But I was surprised to see that EF didn’t provide this out of the box. Not for Self Tracking entities. Not for “standard” entities.&lt;/p&gt;  &lt;p&gt;I’ve told &lt;a href="http://rbroida.alner.net/" target="_blank"&gt;Richard Broida&lt;/a&gt; that EF is my friend. It’s still my friend. I just want my friend to be more helpful. I guess I’ll pick up the slack for now.&lt;/p&gt;  &lt;p&gt;Cheers!&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/105.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/04/13/entity_framework_does_not_enforce_maxlength_metadata.aspx</guid>
            <pubDate>Tue, 13 Apr 2010 19:42:00 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/105.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/04/13/entity_framework_does_not_enforce_maxlength_metadata.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/105.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/105.aspx</trackback:ping>
        </item>
        <item>
            <title>VS 2010 Premium RTM &amp;ndash; Got It!</title>
            <link>http://blog.alner.net/archive/2010/04/13/vs-2010-premium-rtm-ndash-got-it.aspx</link>
            <description>&lt;p&gt;After a couple hiccups with the download yesterday, I finally got the bits and got VS 2010 Premium installed. Great stuff! I’m glad to be running this on the host again, rather than a VM. I can take advantage of multi-monitor, GPU acceleration, and better speed! Hotness!&lt;/p&gt;  &lt;p&gt;My current project is using TFS Power Tools for the check-in policies. My searching indicates that RTM versions are not available yet. So, I’m hoping that the TFS Power Tools RC bits will do for now. As far as I can tell, it’s working so far. My work item policy, comments, and up-to-date-build policies are all nagging me appropriately.&lt;/p&gt;  &lt;p&gt;Upward and onward!&lt;/p&gt;  &lt;p&gt;Cheers.&lt;/p&gt;&lt;img src="http://blog.alner.net/aggbug/104.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Nathan Allen-Wagner</dc:creator>
            <guid>http://blog.alner.net/archive/2010/04/13/vs-2010-premium-rtm-ndash-got-it.aspx</guid>
            <pubDate>Tue, 13 Apr 2010 12:04:28 GMT</pubDate>
            <wfw:comment>http://blog.alner.net/comments/104.aspx</wfw:comment>
            <comments>http://blog.alner.net/archive/2010/04/13/vs-2010-premium-rtm-ndash-got-it.aspx#feedback</comments>
            <wfw:commentRss>http://blog.alner.net/comments/commentRss/104.aspx</wfw:commentRss>
            <trackback:ping>http://blog.alner.net/services/trackbacks/104.aspx</trackback:ping>
        </item>
    </channel>
</rss>