<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://mbrownchicago.spaces.live.com/mmm2008-07-24_12.50/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fmbrownchicago.spaces.live.com%2fcategory%2fProgramming%2bWPF%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Brownie Points: Programming WPF</title><description /><link>http://mbrownchicago.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=catProgramming%2bWPF</link><language>en-US</language><pubDate>Fri, 05 Sep 2008 20:42:24 GMT</pubDate><lastBuildDate>Fri, 05 Sep 2008 20:42:24 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://mbrownchicago.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>2459489012663404964</live:id><live:alias>mbrownchicago</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>How "Cider" Saved the Day</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!662.entry</link><description>&lt;p&gt;Or &amp;quot;My New Favorite Feature of the WPF Designer&amp;quot; &lt;p&gt;So I'm giving a quick presentation of my favorite new feature in VS 2008 at the Wisconsin .NET User Group Installfest, and because I hadn't actually prepared for the presentation in advance, Murphy's Law is in full effect. My normally snappy computer is crawling through the simplest of tasks (because I'm on battery power save mode). I'm floundering here and want to hurry and finish the demonstration (the &amp;quot;Cider&amp;quot; WPF designer). So now I'm standing in a pool of my sweat, I can't even see because the saline is dripping into my eyes. And I have to remember the syntax for importing a CLR namespace. I look to a familiar face &amp;quot;Quick what's the syntax for importing an assembly for reference in XAML?&amp;quot; Travis looks back at me with a blank stare. So I start typing hoping that something will pop in my head when I see: &lt;p&gt;&lt;a href="http://gs7x7a.blu.livefilestore.com/y1pCQfY1MZcUVfX8XTAQUFhB2Tec0VkKbXqjPGLOSOFaqbIWQqjm2hXLVdL8KnLxx6JUjl4qIFZdlQah0EEd3a-gg?PARTNER=WRITER"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px" height=404 alt=image src="http://gs7x7a.blu.livefilestore.com/y1pDpMhT_wGsW4hcpwh_MzrIH0jUxIB192fhxTnd6g7SuvAFj-2YDqdNMnQZuCV2aUosUVRhLir7w3-yTR_Y8fWadYleT2RPAZf?PARTNER=WRITER" width=644 border=0&gt;&lt;/a&gt;  &lt;p&gt;At that very moment, I felt that Team Cider had put this feature in there for this very situation. I stated emphatically...well there you have my new favorite feature! &lt;p&gt;Overall the meeting was great. The turnout was HUGE. We had an assembly hall filled with people ready to install VS2008 (Professional this time as opposed to the 2005 launch when they gave out Standard). I forgot my full camera and for some reason, I can't email the pictures from my phone so I'll refer you to &lt;a href="http://larryclarkin.com/" target="_blank"&gt;Larry Clarkin&lt;/a&gt;.  &lt;p&gt;Hands down the best mini demo in my eyes was the demonstration of the code metrics capabilities of the VS 2008 Team Editions, the presenter of that feature won a copy of SceneIT! for the Xbox 360. &lt;a href="http://brennan.offwhite.net/blog/" target="_blank"&gt;Brennan&lt;/a&gt; won an 8 GB Zune for his presentation. There were a ton of toys donated in exchange for a raffle ticket. The winner got an Xbox 360 Elite with Halo 3 Limited Edition (not Legendary). And the food spread was fantastic. Especially the nacho toppings...chili and queso dip poured over tortillas is delicious! Overall, it looks like everyone enjoyed themselves. At the very least they got a free copy of VS 2008 Pro.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+How+%22Cider%22+Saved+the+Day&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!662.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!662.entry</guid><pubDate>Wed, 19 Dec 2007 21:18:03 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!662/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!662.entry#comment</wfw:comment><dcterms:modified>2007-12-19T21:18:03Z</dcterms:modified></item><item><title>Silverlight 2.0 AKA Heaven on Earth</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!635.entry</link><description>&lt;p&gt;From &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/11/29/net-web-product-roadmap-asp-net-silverlight-iis7.aspx" target="_blank"&gt;Scott Guthrie's announcement&lt;/a&gt;: &lt;blockquote&gt; &lt;p&gt;&lt;u&gt;WPF UI Framework&lt;/u&gt;: The current Silverlight Alpha release only includes basic controls support and a managed API for UI drawing.  The next public Silverlight preview will add support for the higher level features of the WPF UI framework.  These include: the extensible control framework model, layout manager support, two-way data-binding support, and control template and skinning support.  The WPF UI Framework features in Silverlight will be a compatible subset of the WPF UI Framework features in last week's .NET Framework 3.5 release.&lt;/blockquote&gt; &lt;p&gt;I figured that Silverlight would get better by the time of release, so this doesn't surprise me much. But I see more bullet points that attract my eye. Reading further: &lt;blockquote&gt; &lt;p&gt;&lt;u&gt;Rich Controls&lt;/u&gt;: Silverlight will deliver a rich set of controls that make building Rich Internet Applications much easier.  The next Silverlight preview release will add support for core form controls (textbox, checkbox, radiobutton, etc), built-in layout management controls (StackPanel, Grid, etc), common functionality controls (TabControl, Slider, ScrollViewer, ProgressBar, etc) and data manipulation controls (DataGrid, etc).&lt;/blockquote&gt; &lt;p&gt;I'll refrain from sullying your screen with the filth that spewed out of my mouth when I read this (ESPECIALLY the bit about the built in DataGrid); but it was pretty much a recreation of the scene in &lt;a href="http://www.imdb.com/title/tt0144117/" target="_blank"&gt;Boondock Saints&lt;/a&gt; when Roc discovered that the McManus brothers had killed a room full of Russian Mafiosi (just discovered that word is the plural of Mafioso thanks to Live Writer). Back on subject, this is nothing short of amazing news! Let's not forget the fact that this release will run on Macs and Linux. Add in the networking APIs and BCL support (including LINQ) and you have a compelling development platform. Excluding the WPF 3D library, Silverlight 2.0 will essentially live up to the original Silverlight codename and be WPF Everywhere. &lt;p&gt;Oh here was the killer! Silverlight 2.0 will go into Beta soon with Go Live license! &lt;p&gt;Scott's post has some stuff in there about ASP.NET and Ajax and stuff...but I wasn't really listening to all that. It sounds good and all but not half as thrilling as the Silverlight news. Adobe who?&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Silverlight+2.0+AKA+Heaven+on+Earth&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!635.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!635.entry</guid><pubDate>Fri, 30 Nov 2007 02:33:37 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!635/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!635.entry#comment</wfw:comment><dcterms:modified>2007-11-30T02:33:37Z</dcterms:modified></item><item><title>Blendables</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!540.entry</link><description>&lt;p&gt;I haven't posted about this yet in my blog because I assumed everyone involved with WPF development already knew about it. IdentityMine is creating a set of utilities for WPF called &lt;a href="http://www.blendables.com/" target="_blank"&gt;Blendables&lt;/a&gt;. Basically, the focus of Blendables is to provide additional functionality for WPF that is accessible through XAML. One cool example is the Drag-and-drop implemented through an attached property. (Looks like someone finally took my advice on using attached properties to extend functionality). &lt;p&gt;Blendables is very similar to what my initial vision of the WPF Toolbelt. A library that exposes more of the WPF framework directly to XAML with minimum code-behind.  It's great to see the third party support really taking off for WPF. &lt;p&gt;While you're at the Blendables website, they are having a contest for people to showcase what Blendables has allowed them to do. Top prize is a 360 Elite. I won't have time to submit a proper entry...I'm busy with other things.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Blendables&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!540.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!540.entry</guid><pubDate>Wed, 12 Sep 2007 23:18:41 GMT</pubDate><slash:comments>1</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!540/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!540.entry#comment</wfw:comment><dcterms:modified>2007-09-12T23:18:41Z</dcterms:modified></item><item><title>Wow...Just Wow</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!455.entry</link><description>&lt;p&gt;Not to be topped by the incredible &lt;a href="http://www.vista.si" target="_blank"&gt;vista desktop in Silverlight&lt;/a&gt;, a new software shop has released a set of tools that apparently reproduce a vast number of Winforms controls in Silverlight. It's somewhat hard to explain so just &lt;a href="http://community.netikatech.com/demos/" target="_blank"&gt;look at this&lt;/a&gt;. Note in particular the friggin' WINFORMS DESIGNER clone. Again...WOW! By the way, their tool also supports flash and has a free edition (that's missing some &amp;quot;advanced&amp;quot; controls...like a data grid), and a Professional Edition. &lt;p&gt;Definitely a way to increase your beta radiation levels.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Wow...Just+Wow&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!455.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!455.entry</guid><pubDate>Sun, 24 Jun 2007 00:28:16 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!455/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!455.entry#comment</wfw:comment><dcterms:modified>2007-06-24T00:35:50Z</dcterms:modified></item><item><title>Acropolis</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!433.entry</link><description>&lt;p&gt;If you remember, I spoke a bit about providing a rich designer for Business Analysts to define the flow of an application. It looks like &lt;a href="http://windowsclient.net/Acropolis/Default.aspx" target="_blank"&gt;Acropolis&lt;/a&gt; will go a long way toward realizing that dream. If you look at &lt;a href="http://blogs.msdn.com/gblock/archive/2007/06/06/acropolis-the-future-of-smart-client.aspx" target="_blank"&gt;Glenn Block's synopsis&lt;/a&gt;, you'll see that it basically describes what I was talking about to a tee. Now I know why &lt;a href="http://rrelyea.spaces.live.com/blog/cns!167AD7A5AB58D5FE!1935.entry" target="_blank"&gt;Rob's only comment&lt;/a&gt; about the Domain Tree concept was &amp;quot;very interesting&amp;quot;. He knew what was coming. 
&lt;p&gt;I for one am excited!&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Acropolis&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!433.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!433.entry</guid><pubDate>Mon, 11 Jun 2007 17:02:36 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!433/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!433.entry#comment</wfw:comment><dcterms:modified>2007-06-11T17:02:36Z</dcterms:modified></item><item><title>Improving the Combobox</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!426.entry</link><description>&lt;p&gt;If anyone has tried loading a large number of items into a ComboBox...you've probably run into a long pause as the ComboBox renders an Element for each......and.....every....object....in....your....itemssource. You might have even resorted to using a ListBox instead even though it doesn't quite fit in your UI. &lt;p&gt;Fear not my fellow WPF'ers because I have found the solution to your pain. ComboBox derives from ItemsControl and as such, has a ItemsPanel property of type ItemsPanelTemplate. &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt; &lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;x:Key&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Template_ComboPanel&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt; &lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;   &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;VirtualizingStackPanel&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;IsVirtualizing&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;True&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt; &lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;If you set the ItemsPanelTemplate to use a VirtualizingStackPanel, the ComboBox will virtualize and you will have a much more responsive ComboBox. Even better, setup a Style for all ComboBoxes in your app and set the ItemsPanel to be that IPT. You'll be a much happier camper. My Combobox holding 5000 objects used to take around 5-10 seconds to show the popup. Now it pops up instantly. &lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Improving+the+Combobox&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!426.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!426.entry</guid><pubDate>Sat, 02 Jun 2007 21:24:34 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!426/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!426.entry#comment</wfw:comment><dcterms:modified>2007-06-02T21:24:34Z</dcterms:modified></item><item><title>MVC and WPF</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!375.entry</link><description>&lt;p&gt;So I am acutely aware that there is some confusion in the world about just what MVC is. I thought the paradigm I have been using for WPF would be considered MVC but after further research, I learned that while it is technically MVC, it is not what will first come to mind when you hear MVC. What I have been doing is making the View totally dumb. The only &amp;quot;knowledge&amp;quot; it has of the Model is imparted to it through databindings against properties exposed to it through my Controller. With &amp;quot;Pure&amp;quot; MVC, the View has a knowledge of the Model and can even act on it directly in some cases. 
&lt;p&gt;Doing a little more digging, I thought that I had found a name to the design pattern I have been using: &lt;a href="http://www.martinfowler.com/eaaDev/PassiveScreen.html" target="_blank"&gt;Passive View.&lt;/a&gt; Martin Fowler's definition of the Passive View definitely fits the bill for what I do: 
&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;A screen and components with all application specific behavior extracted into a controller so that the widgets have their state controlled entirely by controller.&lt;/i&gt;&lt;/blockquote&gt;
&lt;p&gt;Martin's description of the passive view says that it's primary benefit is that it makes your application more testable. I definitely have seen that benefit. I also have noticed that my code is more flexible to change when using this design. 
&lt;p&gt;However, I must point out that my Controller doesn't actively update the view. It exposes properties that the View binds against. I also couple my MVC with the Command pattern (WPF really lends itself to the Command pattern seeing that it has the ICommand interface and certain UI elements have Command properties on them). All of my Controllers have a command that they expose for binding by the View, you could implement INotifyPropertyChanged, but I have been using Dependency Properties to handle all of those nuances. 
&lt;p&gt;Here is an example of how I would code a UI to all a user to search for an order in a customer service application. First we have the command OrderSearch (it might be an extension to a base Search Command or it might be the rSearch command with a Parameter SearchRequest that has an SearchType property (either way there will be an SearchRequest parameter). In this instance, my controller would also expose properties such as AvailableSearchFields, SelectedSearchField, SelectedSearchValue, and Results. 
&lt;p&gt;The View (in this case a UserControl subclass) would have its DataContext set to an instance of the Controller. There would be a ComboBox with its ItemsSource=&amp;quot;{Binding AvailableSearchFields}&amp;quot; and SelectedItem=&amp;quot;{Binding SelectedSearchField}&amp;quot;. There is also a TextBox with its Text=&amp;quot;{Binding SelectedSearchValue}&amp;quot; and a Button Command=&amp;quot;{Binding Command}&amp;quot;. 
&lt;p&gt;The only code behind required is the constructor which creates the controller and sets the control's datacontext to the controller. (And that's actually handled in the base class of the UserControl). 
&lt;p&gt;As you can see, there is NO logic in the UserControl, it only binds to (or observes) the Controller. Also, the Controller has no logic that deals with the UserControl directly...it only exposes properties, and performs logic in response to values being set. 
&lt;p&gt;The more I think about this pattern, the less it seems that it exactly matches Passive View, because Passive View implies that the Controller actually performs actions on the View. Again, my controller has no knowledge whatsoever of the view. It is not &amp;quot;Pure&amp;quot; MVC either because the View has no knowledge of the Model...I think this does follow the pattern that Dan Crevier described &lt;a href="http://blogs.msdn.com/dancre/archive/2006/07/23/676272.aspx" target="_blank"&gt;with Model - View - ViewModel.&lt;/a&gt; After going back and reading his blog further, this is exactly what this pattern is. I must have subconciously followed it. Anyway, I guess that this is just confirmation that it is definitely a pattern that works. 
&lt;p&gt;Using this pattern, my code is orders of magnitude more flexible and testable than using the code behind to drive the UI. I would also argue that it lends itself toward an SOA approach because of the Commands that are used to drive actions. In theory the same controller could be used to expose functionality to a website or to a Winforms UI. In order to do that, we'd probably want to move away from using DependencyProperties and instead implement INotifyPropertyChanged. Also we'd want to move from the WPF specific Command and create a Converter from our custom Command to WPF's ICommand. 
&lt;p&gt;While I was putting my thoughts together on this posting, Paul Stovell again one upped me and posted his thoughts on &amp;quot;&lt;a href="http://www.paulstovell.net/blog/index.php/binding-oriented-programming/" target="_blank"&gt;Binding Oriented Programming&lt;/a&gt;&amp;quot;. He is more or less following the same pattern I use for WPF development. 
&lt;div&gt;Technorati tags: &lt;a href="http://technorati.com/tags/WPF" rel=tag&gt;WPF&lt;/a&gt;, &lt;a href="http://technorati.com/tags/MVC" rel=tag&gt;MVC&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Patterns" rel=tag&gt;Patterns&lt;/a&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+MVC+and+WPF&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!375.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!375.entry</guid><pubDate>Fri, 25 May 2007 17:56:07 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!375/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!375.entry#comment</wfw:comment><dcterms:modified>2007-05-25T17:56:07Z</dcterms:modified></item><item><title>Low-Level Graphic Manipulation</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!358.entry</link><description>&lt;div&gt;A while ago, I participated in a discussion in the forums about creating a webcam solution in WPF. My suggestion was to use the BitmapSource API to update a bitmap source dependency property with the buffer from a custom directshow filter.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The problem with that solution is that it involves a buffer copy rather than just updating a reference to point to the new buffer. A relatively new voice in the WPF Forums, Jeremiah Morrill, took the time to learn the WIC enough to get the raw buffer pointer in a BitmapSource and redirect it to look at another buffer. &lt;a href="http://jmorrill.hjtcentral.com/Home/tabid/428/BlogID/14/Default.aspx"&gt;Here's his blog about it&lt;/a&gt;.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Low-Level+Graphic+Manipulation&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!358.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!358.entry</guid><pubDate>Tue, 22 May 2007 22:33:42 GMT</pubDate><slash:comments>2</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!358/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!358.entry#comment</wfw:comment><dcterms:modified>2007-05-22T22:33:42Z</dcterms:modified></item><item><title>More Attached Goodness</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!331.entry</link><description>&lt;p&gt;&lt;a href="http://www.fileden.com/files/2007/5/8/1059314/WPFUtils.cs"&gt;Here's the code&lt;/a&gt;, read on for the explanation. &lt;p&gt;So hopefully my last series on enabling MultiSelect checkboxes with attached properties reinforced the idea that the WPF team has been trying to bring home: subclassing a control should be used in extreme circumstances, because most enhancements can be done using Styles, Templates, and as I just showed Attached Properties. Here's yet another trick that we're using in a custom project. &lt;p&gt;For some reason the &lt;a href="http://blogs.msdn.com/atc_avalon_team/" target="_blank"&gt;ATC team&lt;/a&gt; didn't provide an IsSortable property on the GridView...all though they did show how simple it is to &lt;a href="http://blogs.msdn.com/atc_avalon_team/archive/2006/03/03/542803.aspx" target="_blank"&gt;add sorting to a gridview&lt;/a&gt; using code behind. Well you know me, I like simple. So I created an Attached Property that uses the &lt;strike&gt;Plover&lt;/strike&gt; Remora Pattern to add sorting to a ListView (with a Gridview as its View) without any code-behind (other than the code that's in the attached property). The final XAML to use this functionality is as simple as this: &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ListView&lt;br&gt;&lt;/span&gt;&lt;span style="color:red"&gt;&lt;font color="#0000ff"&gt;  &lt;/font&gt;Util:WPFUtils.IsGridSortable&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;True&lt;/span&gt;&amp;quot;&lt;br&gt;  &lt;span style="color:red"&gt;Width&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Auto&lt;/span&gt;&amp;quot;&lt;br&gt;&lt;span style="color:red"&gt;  Height&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Auto&lt;/span&gt;&amp;quot;&lt;br&gt;&lt;/div&gt; &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;&lt;span style="color:blue"&gt;  &lt;/span&gt;&lt;span style="color:red"&gt;ItemsSource&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;{Binding MyItems}&lt;/span&gt;&amp;quot;&lt;br&gt;&lt;span style="color:blue"&gt;  &lt;/span&gt;&lt;span style="color:red"&gt;SelectionMode&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Multiple&lt;/span&gt;&amp;quot;&lt;br&gt;&lt;span style="color:blue"&gt;  &lt;/span&gt;&lt;span style="color:red"&gt;Margin&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;5&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ListView.View&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;GridView&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;         &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;GridViewColumn&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Name&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;DisplayMemberBinding&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;{Binding Name}&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;         &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;GridViewColumn&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Department&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;DisplayMemberBinding&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;{Binding Department}&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/div&gt; &lt;p style="font-size:10pt;background:white;margin:0px;color:black;font-family:courier new"&gt;&lt;span style="color:blue"&gt;         &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;GridViewColumn&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Extension&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;DisplayMemberBinding&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;{Binding Extension}&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;GridView&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ListView.View&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ListView&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt; &lt;p&gt;Basically all you have to do to make your GridView sortable is set the attached property IsGridSortable to true and it handles the rest. Since we already know how the Remora property works (an attached property adds functionality to the Control it's attached to during the PropertyChangedCallback) We'll cut straight to the code for our PropertyChangedCallback. (Full code will be available at the end of this posting). &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt; &lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; OnRegisterSortableGrid(&lt;span style="color:teal"&gt;DependencyObject&lt;/span&gt; sender,&lt;br&gt;  &lt;span style="color:teal"&gt;DependencyPropertyChangedEventArgs&lt;/span&gt; args)&lt;br&gt;{&lt;br&gt;  &lt;span style="color:teal"&gt;ListView&lt;/span&gt; grid = sender &lt;span style="color:blue"&gt;as&lt;/span&gt; &lt;span style="color:teal"&gt;ListView&lt;/span&gt;;&lt;br&gt;  &lt;span style="color:blue"&gt;if&lt;/span&gt; (grid != &lt;span style="color:blue"&gt;null&lt;/span&gt;)&lt;br&gt;  {&lt;br&gt;    RegisterSortableGridView(grid, args);&lt;br&gt;  }&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; RegisterSortableGridView(&lt;span style="color:teal"&gt;ListView&lt;/span&gt; grid,&lt;br&gt;  &lt;span style="color:teal"&gt;DependencyPropertyChangedEventArgs&lt;/span&gt; args)&lt;br&gt;{&lt;br&gt;  &lt;span style="color:blue"&gt;if&lt;/span&gt; (args.NewValue &lt;span style="color:blue"&gt;is&lt;/span&gt; &lt;span style="color:teal"&gt;Boolean&lt;/span&gt; &amp;amp;&amp;amp; (&lt;span style="color:teal"&gt;Boolean&lt;/span&gt;)args.NewValue)&lt;br&gt;  {&lt;br&gt;    grid.AddHandler(&lt;span style="color:teal"&gt;GridViewColumnHeader&lt;/span&gt;.ClickEvent, GridViewColumnHeaderClickHandler);&lt;br&gt;  }&lt;br&gt;  &lt;span style="color:blue"&gt;else&lt;/span&gt;&lt;br&gt;  {&lt;br&gt;    grid.RemoveHandler(&lt;span style="color:teal"&gt;GridViewColumnHeader&lt;/span&gt;.ClickEvent, GridViewColumnHeaderClickHandler);&lt;br&gt;  }&lt;br&gt;}&lt;/div&gt; &lt;p&gt;The callback basically checks if the property has been set on a listview (I am of course adding a check for if it's set on a PowerGrid) and if so calls the RegisterSortableGridView function. This function adds a custom handler for the GridViewColumnHeader.Click Event or removes it based on the value assigned to the property by the user. The handler works pretty much the same way as the ATC sample with a few differences. &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt; &lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;if&lt;/span&gt; (header != &lt;span style="color:blue"&gt;null&lt;/span&gt;)&lt;br&gt;{&lt;br&gt;  &lt;span style="color:teal"&gt;ListSortDirection&lt;/span&gt; sortDirection;&lt;br&gt;  &lt;span style="color:teal"&gt;GridViewColumnHeader&lt;/span&gt; tmpHeader = &lt;span style="background:yellow"&gt;GetLastSorted(lv);&lt;/span&gt;&lt;br&gt;  &lt;span style="color:blue"&gt;if&lt;/span&gt; (tmpHeader != &lt;span style="color:blue"&gt;null&lt;/span&gt;)&lt;br&gt;    tmpHeader.Column.HeaderTemplate = &lt;span style="color:blue"&gt;null&lt;/span&gt;;&lt;br&gt;  &lt;span style="color:blue"&gt;if&lt;/span&gt; (header != tmpHeader)&lt;br&gt;    sortDirection = &lt;span style="color:teal"&gt;ListSortDirection&lt;/span&gt;.Ascending;&lt;br&gt;  &lt;span style="color:blue"&gt;else&lt;br&gt;&lt;/span&gt;  {&lt;br&gt;    &lt;span style="color:teal"&gt;ListSortDirection&lt;/span&gt; tmpDirection = &lt;span style="background:yellow"&gt;GetLastSortDirection(lv);&lt;/span&gt;&lt;br&gt;    &lt;span style="color:blue"&gt;if&lt;/span&gt; (tmpDirection == &lt;span style="color:teal"&gt;ListSortDirection&lt;/span&gt;.Ascending)&lt;br&gt;      sortDirection = &lt;span style="color:teal"&gt;ListSortDirection&lt;/span&gt;.Descending;&lt;br&gt;    &lt;span style="color:blue"&gt;else&lt;br&gt;      &lt;/span&gt;sortDirection = &lt;span style="color:teal"&gt;ListSortDirection&lt;/span&gt;.Ascending;&lt;br&gt;}&lt;/div&gt; &lt;p&gt;You'll see I highlighted calls to two functions GetLastSorted(lv); and GetLastSortDirection(lv). These are Getters for Read-only Attached Dependency Properties LastSorted and LastSortDirection, respectively (and the SDK said they aren't useful), that are set on the ListView during a sort operation...if this is the first sort operation of course they'll be null. The other cool feature... &lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt; &lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;switch&lt;/span&gt; (sortDirection)&lt;br&gt;{&lt;br&gt;&lt;span style="color:blue"&gt;  case&lt;/span&gt; &lt;span style="color:teal"&gt;ListSortDirection&lt;/span&gt;.Ascending: resourceTemplateName = &lt;span style="color:maroon"&gt;&amp;quot;HeaderTemplateSortAsc&amp;quot;&lt;/span&gt;; &lt;span style="color:blue"&gt;break&lt;/span&gt;;&lt;br&gt;  &lt;span style="color:blue"&gt;case&lt;/span&gt; &lt;span style="color:teal"&gt;ListSortDirection&lt;/span&gt;.Descending: resourceTemplateName = &lt;span style="color:maroon"&gt;&amp;quot;HeaderTemplateSortDesc&amp;quot;&lt;/span&gt;; &lt;span style="color:blue"&gt;break&lt;/span&gt;;&lt;br&gt;}&lt;br&gt;&lt;span style="color:teal"&gt;DataTemplate&lt;/span&gt; tmpTemplate = lv.TryFindResource(resourceTemplateName) &lt;span style="color:blue"&gt;as&lt;/span&gt; &lt;span style="color:teal"&gt;DataTemplate&lt;/span&gt;;&lt;br&gt;&lt;span style="color:blue"&gt;if&lt;/span&gt; (tmpTemplate != &lt;span style="color:blue"&gt;null&lt;/span&gt;)&lt;br&gt;{&lt;br&gt;  header.Column.HeaderTemplate = tmpTemplate;&lt;br&gt;}&lt;/div&gt; &lt;p&gt;If the user has declared HeaderTemplateSortAsc and/or HeaderTemplateSortDesc in their resource tree, it will be set on the GridViewColumnHeader. &lt;a href="http://www.fileden.com/files/2007/5/8/1059314/WPFUtils.cs"&gt;Today's upload&lt;/a&gt; only includes the cs file for the WPFUtils class. I'll pull it out of our main app and into it's own project later. &lt;p&gt;Again, this shows that WPF Controls can be customized without subclassing them. And without codebehind for the UI of the code cluttering your business logic code. Next time, I want to talk about MVC with WPF. &lt;p&gt;  &lt;div style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px"&gt;Technorati tags: &lt;a href="http://technorati.com/tags/WPF" rel=tag&gt;WPF&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Attached Properties" rel=tag&gt;Attached Properties&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Code Sample" rel=tag&gt;Code Sample&lt;/a&gt;, &lt;a href="http://technorati.com/tags/XAML" rel=tag&gt;XAML&lt;/a&gt;, &lt;a href="http://technorati.com/tags/WPF Grid" rel=tag&gt;WPF Grid&lt;/a&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+More+Attached+Goodness&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!331.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!331.entry</guid><pubDate>Thu, 10 May 2007 22:00:58 GMT</pubDate><slash:comments>4</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!331/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!331.entry#comment</wfw:comment><dcterms:modified>2007-10-27T14:10:17Z</dcterms:modified></item><item><title>Season Finale</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!330.entry</link><description>&lt;p&gt;When we got to yesterday's cliffhanger, we had all we needed to allow a developer to wire up a group of checkboxes to be checked or unchecked in response to the status of a single &amp;quot;Check/Uncheck All&amp;quot; checkbox with no code-behind. But the Markup to take advantage of it was ugly...well I never showed the markup to take advantage but believe me it was ugly. 
&lt;p&gt;In order to save my fellow WPF developers from Carpal Tunnel Syndrome, I created a markup extension that would enable developers to create a MultiSelectionTarget using Attribute Syntax (similar to declaring a Binding and all that other fun stuff). As I hinted to earlier, creating a Markup Extension is not as scary as it sounds at first. You extend the MarkupExtension class; expose properties that your Markup Extension needs to properly do its job; and override the ProvideValue function to return what the user of your Markup Extension expects (in this case a MultiSelectionTarget). Here it is in all it's glory: 
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;   &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; &lt;span style="color:teal"&gt;MultiSelectionTargetExtension&lt;/span&gt; : &lt;span style="color:teal"&gt;MarkupExtension&lt;/span&gt;&lt;br&gt;    {&lt;br&gt;        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:teal"&gt;String&lt;/span&gt; path;&lt;br&gt;        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:teal"&gt;MultiSelectionSource&lt;/span&gt; source;&lt;br&gt;&lt;br&gt;        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:teal"&gt;String&lt;/span&gt; Path&lt;br&gt;        {&lt;br&gt;            &lt;span style="color:blue"&gt;get&lt;/span&gt; { &lt;span style="color:blue"&gt;return&lt;/span&gt; path; }&lt;br&gt;            &lt;span style="color:blue"&gt;set&lt;/span&gt; { path = &lt;span style="color:blue"&gt;value&lt;/span&gt;; }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:teal"&gt;MultiSelectionSource&lt;/span&gt; Source&lt;br&gt;        {&lt;br&gt;            &lt;span style="color:blue"&gt;get&lt;/span&gt; { &lt;span style="color:blue"&gt;return&lt;/span&gt; source; }&lt;br&gt;            &lt;span style="color:blue"&gt;set&lt;/span&gt; { source = &lt;span style="color:blue"&gt;value&lt;/span&gt;; }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;override&lt;/span&gt; &lt;span style="color:blue"&gt;object&lt;/span&gt; ProvideValue(&lt;span style="color:teal"&gt;IServiceProvider&lt;/span&gt; serviceProvider)&lt;br&gt;        {&lt;br&gt;            &lt;span style="color:blue"&gt;if&lt;/span&gt; (source != &lt;span style="color:blue"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; !&lt;span style="color:teal"&gt;String&lt;/span&gt;.IsNullOrEmpty(path))&lt;br&gt;            {&lt;br&gt;                &lt;span style="color:blue"&gt;return&lt;/span&gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;MultiSelectionTarget&lt;/span&gt;(source, path);&lt;br&gt;            }&lt;br&gt;            &lt;span style="color:blue"&gt;return&lt;/span&gt; &lt;span style="color:blue"&gt;null&lt;/span&gt;;&lt;br&gt;        }&lt;br&gt;    }&lt;/div&gt;
&lt;p&gt;See, piece of cake right. Any former Java developers who created JSP Tags before will be very comfortable with this convention. I'm sure ASP.Net offers similar functionality...but I'm not an ASP.Net developer. Anyway, all of this gives us a very straightforward, all XAML method to check a group of checkboxes at once... 
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Window&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;x:Class&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;SelectAllDemo.Window1&lt;/span&gt;&amp;quot;&lt;br&gt;&lt;span style="color:blue"&gt;    &lt;/span&gt;&lt;span style="color:red"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/span&gt;&amp;quot;&lt;br&gt;&lt;span style="color:blue"&gt;    &lt;/span&gt;&lt;span style="color:red"&gt;xmlns:x&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;&amp;quot;&lt;br&gt;&lt;span style="color:blue"&gt;    &lt;/span&gt;&lt;span style="color:red"&gt;xmlns:local&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;clr-namespace:SelectAllDemo&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;    &lt;/span&gt;&lt;span style="color:red"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;SelectAllDemo&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Height&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;300&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Width&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;300&lt;/span&gt;&amp;quot;&lt;br&gt;&lt;span style="color:blue"&gt;    &amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Window.Resources&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;local:MultiSelectionSource&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;x:Key&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;SelectionSource&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;  &amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:maroon"&gt;Window.Resources&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;StackPanel&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CheckBox&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;IsChecked&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;{Binding Source={StaticResource SelectionSource}, Path=IsSelected}&lt;/span&gt;&amp;quot;&lt;br&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;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Bold&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Select All&lt;span style="color:blue"&gt;&amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:maroon"&gt;CheckBox&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CheckBox&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;local:PowerSelector.MultiSelectorTarget&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;br&gt;&lt;/span&gt;                &amp;quot;&lt;span style="color:blue"&gt;{local:MultiSelectionTarget Source={StaticResource SelectionSource},&lt;br&gt;                Path=IsChecked}&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;      Check me 1&lt;br&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:maroon"&gt;CheckBox&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CheckBox&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;local:PowerSelector.MultiSelectorTarget&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;br&gt;&lt;/span&gt;                &amp;quot;&lt;span style="color:blue"&gt;{local:MultiSelectionTarget Source={StaticResource SelectionSource},&lt;br&gt;                Path=IsChecked}&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;      Check me 2&lt;br&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:maroon"&gt;CheckBox&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;  &amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:maroon"&gt;StackPanel&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:blue"&gt;&amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:maroon"&gt;Window&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;So there you have it. Attached Properties, Multibindings, and MarkupExtensions have come together in harmony to enable multi selection in pure XAML. Further refactoring that I can do with the PowerSelector include making it work with comboboxes as well as checkboxes. This util is going into the WPF Toolbelt, but you can &lt;a href="http://www.fileden.com/files/2007/5/8/1059314/Code Samples/SelectAllDemo.zip"&gt;download the sample now.&lt;/a&gt; 
&lt;p&gt;Up next...using attached properties to make a standard GridView sortable.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Season+Finale&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!330.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!330.entry</guid><pubDate>Wed, 09 May 2007 15:34:05 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!330/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!330.entry#comment</wfw:comment><dcterms:modified>2007-05-10T22:01:39Z</dcterms:modified></item><item><title>Previously on Brownie Points...</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!327.entry</link><description>&lt;p&gt;
&lt;p&gt;&amp;quot;Chloe, in order to prevent the suspected terrorist from escaping, we need the ability to check multiple CheckBoxes at once in our WPF application.&amp;quot; 
&lt;p&gt;&amp;quot;I'm looking at the Brownie Points blog now, Jack. Hopefully he'll post the rest of the solution in time. It would take too long to code it by hand. The other solution using an AttachedProperty works but it results in an iterative search through the Visual Tree, from the looks of it, Brownie takes a different approach by creating bindings from a MultiSelectionSource to each checkbox. If he puts it up in time, we can prevent Anwar Shakur from escaping.&amp;quot; 
&lt;p&gt;&amp;quot;Chloe, why do you always explain information in detail as if I don't know already what you're talking about?&amp;quot; 
&lt;p&gt;&amp;quot;I don't know, Jack, I think the writers needed some way to help the viewers have a quick update of what's going on, so they created me as a person with absolutely no social skills but always in the know so that I could ask the dumb questions that the viewer would know if they had watched last week's show.&amp;quot; 
&lt;p&gt;&lt;strong&gt;The following takes place between 12:00 PM and 1:00 PM&lt;/strong&gt; 
&lt;p&gt;Where were we? Let's look at our Scenario: 
&lt;ol&gt;
&lt;li&gt;In our XAML we declare a MultiSelectionSource in the Window/UserControl/Listbox.Resources. 
&lt;li&gt;The MultiSelectionSource holds a List that it uses to track bindings with MultiSelectionTargets 
&lt;li&gt;We declare MultiSelectionTargets on our checkboxes that point back to our MultiSelectionSource 
&lt;li&gt;The Bindings are generated and added to the MultiSelectionSource, allowing it to (un)check a group of checkboxes at once&lt;/ol&gt;
&lt;p&gt;1 and 2 are both clear, we need to enable 3 and 4. 
&lt;p&gt;Let's declare an Attached Property that is a MultiSelectionTarget. It might be confusing on the MultiSelectionTarget or MultiSelectionSource class, so let's make a utility class, PowerSelector, to hold the property. First we declare the property 
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;    &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; &lt;span style="color:teal"&gt;PowerSelector&lt;br&gt;&lt;/span&gt;    { &lt;br&gt;        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;readonly&lt;/span&gt; &lt;span style="color:teal"&gt;DependencyProperty&lt;/span&gt; MultiSelectorTargetProperty = &lt;br&gt;            &lt;span style="color:teal"&gt;DependencyProperty&lt;/span&gt;.RegisterAttached( &lt;br&gt;                &lt;span style="color:maroon"&gt;&amp;quot;MultiSelectorTarget&amp;quot;&lt;/span&gt;, &lt;br&gt;                &lt;span style="color:blue"&gt;typeof&lt;/span&gt;(&lt;span style="color:teal"&gt;MultiSelectionTarget&lt;/span&gt;), &lt;br&gt;                &lt;span style="color:blue"&gt;typeof&lt;/span&gt;(&lt;span style="color:teal"&gt;PowerSelector&lt;/span&gt;), &lt;br&gt;                &lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;PropertyMetadata&lt;/span&gt;(&lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;PropertyChangedCallback&lt;/span&gt;(TargetAdded))); &lt;br&gt;
&lt;p&gt;        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:teal"&gt;MultiSelectionTarget&lt;/span&gt; GetMultiSelectorTarget(&lt;span style="color:teal"&gt;DependencyObject&lt;/span&gt; obj) &lt;br&gt;        { &lt;br&gt;            &lt;span style="color:blue"&gt;return&lt;/span&gt; (&lt;span style="color:teal"&gt;MultiSelectionTarget&lt;/span&gt;)obj.GetValue(MultiSelectorTargetProperty); &lt;br&gt;        } &lt;br&gt;&lt;br&gt;
&lt;p&gt;        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; SetMultiSelectorTarget(&lt;span style="color:teal"&gt;DependencyObject&lt;/span&gt; obj, &lt;br&gt;          &lt;span style="color:teal"&gt;MultiSelectionTarget&lt;/span&gt; value) &lt;br&gt;        { &lt;br&gt;            obj.SetValue(MultiSelectorTargetProperty, value); &lt;br&gt;        }  &lt;/div&gt;
&lt;p&gt; It's a very non-assuming Attached Property, except it has a PropertyChangedCallback. It's time for our Plover bird to earn its keep 
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;static&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; TargetAdded(&lt;span style="color:teal"&gt;DependencyObject&lt;/span&gt; sender, &lt;br&gt;          &lt;span style="color:teal"&gt;DependencyPropertyChangedEventArgs&lt;/span&gt; e) &lt;br&gt;        { &lt;br&gt;            &lt;span style="color:teal"&gt;MultiSelectionTarget&lt;/span&gt; tmpTarget = e.NewValue &lt;span style="color:blue"&gt;as&lt;/span&gt; &lt;span style="color:teal"&gt;MultiSelectionTarget&lt;/span&gt;; &lt;br&gt;            &lt;span style="color:blue"&gt;if&lt;/span&gt; (tmpTarget != &lt;span style="color:blue"&gt;null&lt;/span&gt;) &lt;br&gt;            { &lt;br&gt;                &lt;span style="color:teal"&gt;Binding&lt;/span&gt; tmpbinding = &lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;Binding&lt;/span&gt;(tmpTarget.Path); &lt;br&gt;                tmpbinding.Source = sender; &lt;br&gt;                tmpbinding.Mode = &lt;span style="color:teal"&gt;BindingMode&lt;/span&gt;.TwoWay; &lt;br&gt;                tmpTarget.Source.AddBinding(tmpbinding); &lt;br&gt;            } &lt;br&gt;        }&lt;/div&gt;
&lt;p&gt;
&lt;p&gt;So it's quite simple...when the PowerSelector.MultiSelectorTarget property (of type MultiSelectionTarget) is set on a DependencyObject, the handler creates a Binding with the sender as the Source and the MultiSelectionTarget.Path as the path. The Binding is given a BindingMode of TwoWay, and we call AddBinding on the MultiSelectionSource passing the new Binding we just created. Soo...I guess we should look at how AddBinding works. 
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;        &lt;span style="color:blue"&gt;internal&lt;/span&gt; &lt;span style="color:blue"&gt;void&lt;/span&gt; AddBinding(&lt;span style="color:teal"&gt;Binding&lt;/span&gt; newBinding) &lt;br&gt;        { &lt;br&gt;            bindings.Add(newBinding); &lt;br&gt;            &lt;span style="color:teal"&gt;MultiBinding&lt;/span&gt; tmpBindings = &lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;MultiBinding&lt;/span&gt;(); &lt;br&gt;            &lt;span style="color:blue"&gt;foreach&lt;/span&gt; (&lt;span style="color:teal"&gt;BindingBase&lt;/span&gt; binding &lt;span style="color:blue"&gt;in&lt;/span&gt; bindings) &lt;br&gt;            { &lt;br&gt;                tmpBindings.Bindings.Add(binding); &lt;br&gt;            } &lt;br&gt;            tmpBindings.Mode = &lt;span style="color:teal"&gt;BindingMode&lt;/span&gt;.TwoWay; &lt;br&gt;            tmpBindings.Converter = &lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;MultiSelectConverter&lt;/span&gt;(); &lt;br&gt;            tmpBindings.ConverterParameter = &lt;span style="color:blue"&gt;this&lt;/span&gt;; &lt;br&gt;            &lt;span style="color:teal"&gt;BindingOperations&lt;/span&gt;.SetBinding(&lt;span style="color:blue"&gt;this&lt;/span&gt;, &lt;span style="color:teal"&gt;MultiSelectionSource&lt;/span&gt;.IsSelectedProperty,&lt;br&gt;              tmpBindings); &lt;br&gt;        } &lt;br&gt;&lt;br&gt;        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; &lt;span style="color:teal"&gt;MultiSelectConverter&lt;/span&gt; : &lt;span style="color:teal"&gt;IMultiValueConverter&lt;/span&gt; &lt;br&gt;        { &lt;br&gt;&lt;br&gt;
&lt;p&gt;            &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;object&lt;/span&gt; Convert(&lt;span style="color:blue"&gt;object&lt;/span&gt;[] values, &lt;span style="color:teal"&gt;Type&lt;/span&gt; targetType, &lt;span style="color:blue"&gt;object&lt;/span&gt; parameter,&lt;br&gt;              System.Globalization.&lt;span style="color:teal"&gt;CultureInfo&lt;/span&gt; culture) &lt;br&gt;            { &lt;br&gt;                &lt;span style="color:teal"&gt;MultiSelectionSource&lt;/span&gt; source = (&lt;span style="color:teal"&gt;MultiSelectionSource&lt;/span&gt;)parameter; &lt;br&gt;                &lt;span style="color:teal"&gt;Boolean&lt;/span&gt; tmpBool = (&lt;span style="color:teal"&gt;Boolean&lt;/span&gt;)values[0];&lt;br&gt;                &lt;span style="color:blue"&gt;if&lt;/span&gt; (values.Length == 1) &lt;br&gt;                    &lt;span style="color:blue"&gt;return&lt;/span&gt; tmpBool; &lt;br&gt;                &lt;span style="color:blue"&gt;else&lt;/span&gt; &lt;br&gt;                    &lt;span style="color:blue"&gt;for&lt;/span&gt; (&lt;span style="color:blue"&gt;int&lt;/span&gt; i = 1; i &amp;lt; values.Length; i++) &lt;br&gt;                    { &lt;br&gt;                        &lt;span style="color:blue"&gt;if&lt;/span&gt; ((&lt;span style="color:blue"&gt;bool&lt;/span&gt;)values[i] != tmpBool) &lt;br&gt;                            &lt;span style="color:blue"&gt;return&lt;/span&gt; source.IsSelected; &lt;br&gt;                    } &lt;br&gt;                &lt;span style="color:blue"&gt;return&lt;/span&gt; tmpBool; &lt;br&gt;            } &lt;br&gt;&lt;br&gt;
&lt;p&gt;            &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;object&lt;/span&gt;[] ConvertBack(&lt;span style="color:blue"&gt;object&lt;/span&gt; value, &lt;span style="color:teal"&gt;Type&lt;/span&gt;[] targetTypes, &lt;span style="color:blue"&gt;object&lt;/span&gt; parameter,&lt;br&gt;              System.Globalization.&lt;span style="color:teal"&gt;CultureInfo&lt;/span&gt; culture) &lt;br&gt;            { &lt;br&gt;                &lt;span style="color:teal"&gt;Boolean&lt;/span&gt; tmpVal; &lt;br&gt;                &lt;span style="color:blue"&gt;try&lt;/span&gt; &lt;br&gt;                { &lt;br&gt;                    tmpVal = (&lt;span style="color:blue"&gt;bool&lt;/span&gt;)value; &lt;br&gt;                } &lt;br&gt;                &lt;span style="color:blue"&gt;catch&lt;/span&gt; (&lt;span style="color:teal"&gt;Exception&lt;/span&gt; e) &lt;br&gt;                { &lt;br&gt;                    &lt;span style="color:blue"&gt;throw&lt;/span&gt; &lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;ArgumentException&lt;/span&gt;(&lt;br&gt;                      &lt;span style="color:maroon"&gt;&amp;quot;This method expects a boolean as its first parameter&amp;quot;&lt;/span&gt;, &lt;span style="color:maroon"&gt;&amp;quot;value&amp;quot;&lt;/span&gt;, e); &lt;br&gt;                } &lt;br&gt;                &lt;span style="color:teal"&gt;Object&lt;/span&gt;[] retVal = &lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;Object&lt;/span&gt;[targetTypes.Length]; &lt;br&gt;                &lt;span style="color:blue"&gt;for&lt;/span&gt; (&lt;span style="color:blue"&gt;int&lt;/span&gt; i = 0; i &amp;lt; retVal.Length; i++) &lt;br&gt;                { &lt;br&gt;                    retVal[i] = tmpVal; &lt;br&gt;                } &lt;br&gt;                &lt;span style="color:blue"&gt;return&lt;/span&gt; retVal; &lt;br&gt;            } &lt;br&gt;        } &lt;br&gt;    }&lt;/div&gt;
&lt;p&gt;Remember bindings is a private IList that MultiSelectionSource declared so the Binding created by the AddTarget handler is added to that list. A new MultiBinding is created and all of the bindings stored in ...umm... bindings are added to it. The MultiBinding is set to TwoWay and a MultiSelectConverter is created and assigned as its converter. (A MultiBinding REQUIRES an IMultivalueConverter to be set on it.) The MultiSelectConverter has pretty simple logic ConvertBack sets all of the Sources to the new Value of the Target...In this case the Sources are MultiSelectionTargets and the target is the MultiSelectionSource. Convert sets the MultiSelectionSource only if all the MultiSelectionTargets agree, otherwise it keeps the same value. 
&lt;p&gt;Finally, in order to simplify life for the end user -- in this case the developer -- I created a markup extension that allows you to create a MultiSelectionTarget using attribute syntax rather than requiring property syntax....which is much more verbose. Markup Extensions aren't as frightening to develop as they first sound. Basically you extend MarkupExtension, put properties on your class and override the ProvideValue method. It's much easier to visualize in code...But I'm out of time for now. I'll wrap it all up later and make the code available for download somehow...I wish spaces allowed you to upload files. 
&lt;p&gt;beep...beep...beep...beep&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Previously+on+Brownie+Points...&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!327.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!327.entry</guid><pubDate>Tue, 08 May 2007 18:24:34 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!327/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!327.entry#comment</wfw:comment><dcterms:modified>2007-05-10T22:01:58Z</dcterms:modified></item><item><title>Code Snippet</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!321.entry</link><description>&lt;div&gt;So it finally got to the point where I was tired enough of &amp;quot;enhancing&amp;quot; my dependency properties by hand that I felt it was worth the investment to learn how to write code snippets. The &amp;quot;Orcas&amp;quot; preview for VS2005 already comes with a few snippets to simplify declaring dependency properties and attached dependency properties (propdp and propa, respectively). But it was missing a few things...I stumbled across some &lt;a href="http://notstatic.com/archives/71"&gt;enhanced snippets at notstatic.com&lt;/a&gt;. But it was still missing something, I needed my snippet to automatically generate the PropertyChangedCallback. So I opened up the snippet to see what I needed to do to add that enhancement.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Surprisingly enough it was quite simple. The snippet uses token substitution to place named parameters into the code. I guess it'd be easier to show you. If anyone else needs this, just save it as propdh.snippet under your %vsinstall%\VC#\Snippets\%lcid%\Visual C# directory where %vsinstall% is your installation root of VS2005 and %lcid% is your locale identifier (1033 for us english).&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:Courier New"&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:maroon"&gt;xml&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;version&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;1.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;encoding&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;?&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Format&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;1.0.0&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Expansion&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetType&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;SnippetTypes&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Define a DependencyProperty&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Title&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;propdph&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Shortcut&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;        Code snippet for a property using DependencyProperty as the backing
&lt;p style=""&gt;        store and a Handler for the DependencyPropertyChanged event
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Description&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Mike Brown&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Author&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Header&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Editable&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;true&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;type&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Property Type&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;int&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Editable&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;true&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;property&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;Property Name&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;MyProperty&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Editable&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;false&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;ownerclass&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;            The owning class of this Property. Typically the class that it is
&lt;p style=""&gt;            declared in.
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;ToolTip&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;ClassNamePlaceholder&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Default&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;          &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;ClassName()&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Function&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Literal&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Declarations&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;Language&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;csharp&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;        &amp;lt;![CDATA[&lt;/span&gt;
&lt;p style=""&gt; 
&lt;p style=""&gt;&lt;span style="color:gray"&gt;public $type$ $property$&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;{&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;    get { return ($type$)GetValue($property$Property); }&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;    set { SetValue($property$Property, value); }&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;}&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;public static readonly DependencyProperty $property$Property = DependencyProperty.Register(&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;  &amp;quot;$property$&amp;quot;, &lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;  typeof($type$), &lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;  typeof($ownerclass$), &lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;  new UIPropertyMetadata(default($type$), new PropertyChangedCallback(On$property$Changed)));&lt;/span&gt;
&lt;p style=""&gt; 
&lt;p style=""&gt;&lt;span style="color:gray"&gt;private static void On$property$Changed(DependencyObject sender, DependencyPropertyChangedEventArgs args)&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;{&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;  $ownerclass$ tmp$ownerclass$ = sender as $ownerclass$;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;  if (tmp$ownerclass$!=null)&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;  {&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;    //TODO: Do what you need to do with the new value.&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;  }&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;}&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:gray"&gt;$end$&lt;/span&gt;&lt;span style="color:blue"&gt;]]&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;      &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Code&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;Snippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;  &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippet&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;
&lt;p style=""&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;CodeSnippets&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Code+Snippet&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!321.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!321.entry</guid><pubDate>Mon, 07 May 2007 15:48:54 GMT</pubDate><slash:comments>3</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!321/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!321.entry#comment</wfw:comment><dcterms:modified>2007-05-07T15:48:54Z</dcterms:modified></item><item><title>Code Climber: Custom Controls</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!274.entry</link><description>&lt;p&gt; So a &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1154977&amp;amp;SiteID=1" target="_blank"&gt;user was asking&lt;/a&gt; in the WPF Forums how to get a UserControl to call a method on its parent. I told him the simplest way is to use a RoutedEvent and proceeded to give a code example that showed the basics. &lt;p&gt;&lt;a href="http://blogs.msdn.com/charlie" target="_blank"&gt;Charlie Calvert&lt;/a&gt; is doing a series that he calls &lt;a href="http://blogs.msdn.com/charlie/archive/2007/01/17/code-climber-delegates.aspx" target="_blank"&gt;Code Climber&lt;/a&gt; which discusses &lt;a href="http://dotnetaddict.dotnetdevelopersjournal.com/lambda.htm" target="_blank"&gt;Lambdas&lt;/a&gt; from the bottom up. I'm sure it will be a great series when it's all done. &lt;p&gt;This post inspired me to do a Code Climber of my own. I want to cover custom controls in WPF. Of course, the MSDN library already has a great &lt;a href="http://msdn2.microsoft.com/en-us/library/ms745025.aspx" target="_blank"&gt;overview of WPF control authoring&lt;/a&gt;, I wouldn't presume to replace that documentation especially for those with a pressing deadline to learn this topic. But for those willing to take a journey with me, it could be fun. &lt;p&gt;Here is the Itinerary for our voyage: &lt;ul&gt; &lt;li&gt;Window/Frame &lt;li&gt;UserControl &lt;li&gt;Control &lt;li&gt;FrameworkElement&lt;/ul&gt; &lt;p&gt;The stops follow the path from commonplace, (I.e. practically every WPF UI developer will use a Window or Frame) to the more esoteric FrameworkElement. Interestingly enough, FrameworkElement based custom controls may be MOST familiar to those used to custom control development for Winforms/GDI+, where developers are used to rendering the control directly using graphics primitives. Whereas the paradigm for developing custom controls that derive from &lt;a href="http://msdn2.microsoft.com/en-gb/library/system.windows.controls.control.aspx" target="_blank"&gt;System.Windows.Controls.Control&lt;/a&gt; would be most familiar for someone developing an ASP.Net server-side control. &lt;p&gt;It's a little bit past my bedtime, but look forward to seeing the first entry talking about everyone's favorite custom control: Window1.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Code+Climber%3a+Custom+Controls&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!274.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!274.entry</guid><pubDate>Thu, 08 Feb 2007 07:43:58 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!274/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!274.entry#comment</wfw:comment><dcterms:modified>2007-02-08T07:43:58Z</dcterms:modified></item><item><title>DM-V-VM Series</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!253.entry</link><description>&lt;div&gt;Dan Crevier put a nice summary post for his &lt;a href="http://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx"&gt;Data Model - View - View Model series&lt;/a&gt; on his blog. I'm putting it on my blog so that I can find it more easily.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+DM-V-VM+Series&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!253.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!253.entry</guid><pubDate>Mon, 18 Dec 2006 19:54:30 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!253/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!253.entry#comment</wfw:comment><dcterms:modified>2006-12-18T19:54:30Z</dcterms:modified></item><item><title>Two New Releases</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!178.entry</link><description>&lt;div&gt;Everybody with dreams of developing a video game should know by now that the beta of XNA Game Studio Express has been released today. Although this version doesn't support developing for the 360, you can get started now developing for windows and when the December release arrives, your code will port to the 360. Why are you still reading this? &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=21e979e3-b8ae-4ea6-8e65-393ea7684d6c&amp;amp;displaylang=en"&gt;GO GET IT&lt;/a&gt;!&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Arriving with a bit less fanfare was the Windows Vista August CTP on MSDN subscriber downloads. I haven't seen a matching orcas/windows sdk release for it yet, but I'm sure one will be following soon...with the pomp and circumstance due another preview of Vista. The odd thing was that I thought this was supposed to be RC1...anyway if you're an MSDN subscriber go ahead and get the August CTP.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Of course all this comes when I'm trying to design my converter for the &lt;a href="http://wpf.netfx3.com/content/ConversionContest.aspx"&gt;XAML conversion contest&lt;/a&gt;! It's a conspiracy I tell you. C-O-N-spiracy.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Two+New+Releases&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!178.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!178.entry</guid><pubDate>Thu, 31 Aug 2006 02:23:52 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!178/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!178.entry#comment</wfw:comment><dcterms:modified>2006-08-31T02:23:52Z</dcterms:modified></item><item><title>Big News!!!!</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!147.entry</link><description>&lt;div&gt;I have been given the green light to turn the WPF grid control that I've been developing at work into an open source project. My hope is that it will become a full suite of controls that help WPF developers become productive just as quickly as Winforms developers. Leave a comment here if you're interested in learning more (e.g. when it's available) and/or joining the project.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Assuming codeplex ever approves my request that is &lt;img src="rte/emoticons/smile_tongue.gif"&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Big+News!!!!&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=mbrownchicago.spaces.live.com&amp;amp;GT1=mbrownchicago"&gt;</description><comments>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!147.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!147.entry</guid><pubDate>Fri, 21 Jul 2006 22:08:23 GMT</pubDate><slash:comments>5</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!147/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!147.entry#comment</wfw:comment><dcterms:modified>2006-07-21T22:08:23Z</dcterms:modified></item></channel></rss>