<?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%2fLearning%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: Learning WPF</title><description /><link>http://mbrownchicago.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=catLearning%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>Supporting Input Binding for the Delegating Command</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!609.entry</link><description>&lt;p&gt;So after some research, I discovered what it takes to support Input Binding (E.G. key gestures) for the &lt;a href="http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!596.entry" target="_blank"&gt;Delegating Command&lt;/a&gt;: absolutely nothing. Although you can configure a Routed Command's Input Bindings using the Command Manager, you can also do it in XAML using UIElement.InputBindings like so: &lt;p&gt;&amp;lt;Window.InputBindings&amp;gt; &lt;br&gt;  &amp;lt;KeyBinding Key=&amp;quot;B&amp;quot; Modifiers=&amp;quot;Control&amp;quot; Command=&amp;quot;ApplicationCommands.Open&amp;quot; /&amp;gt; &lt;br&gt;&amp;lt;/Window.InputBindings&amp;gt; &lt;p&gt;Here's the really fun part. You can configure Input Bindings for any ICommand (like a Delegating Command exposed as a property on your View Model (or Acropolis Part)). In all honesty, I'm seeing less and less use for Routed Commands. I for one won't be using them going forward. &lt;p&gt;It's time for us to begin sailing the 4C's again. I've just dusted off Part Two of Code Climber Custom Controls and it's going to be a doozy just like &lt;a href="http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!277.entry" target="_blank"&gt;it's predecessor&lt;/a&gt;. It just needs one more evening/morning writing cycle to complete.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Supporting+Input+Binding+for+the+Delegating+Command&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!609.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!609.entry</guid><pubDate>Thu, 18 Oct 2007 12:00:05 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!609/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!609.entry#comment</wfw:comment><dcterms:modified>2007-10-18T12:00:39Z</dcterms:modified></item><item><title>So this is Vista</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!544.entry</link><description>&lt;p&gt;&lt;a href="http://blufiles.storage.msn.com/y1p8EpAlDbvGPkM74od5nSBoOamF8LYjuzQ5ZT9Tq_yOBCuVLSZweE9vT2aypbyLyHXlFkoHvEVQE8?PARTNER=WRITER" target="_blank"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px" height=154 alt=vista-wow src="http://blufiles.storage.msn.com/y1p8EpAlDbvGPm2pfjISmvwoDJBpVGCtII9DXIJaj1CZ5BOyW-s9qQLkqqH8S-YSjx5SK8XbuF_zqA?PARTNER=WRITER" width=244 align=left border=0&gt;&lt;/a&gt;I've been running Vista at the office since Beta 2. And although I ran it on my old mule of a laptop at home, it didn't quite have enough to enable Aero...I actually wish I had a screen shot of the 1.0 graphics score it got. While graphics are still a liability on my laptop...(I probably won't be playing Halo 2 on it), it did manage to get a 3.0. Everything else was in the high 4's. Now that I have a personal machine that can do everything Vista is capable of, I've had a few wow moments. Like when I did the win+tab switching while a video was playing in IE...(a Silverlight video no less) and it was streaming seamlessly in the preview mode. Or when I hovered over the task bar and saw the same thing. The screen shot Doesn't do it justice...but if you've seen it in action, you know what I'm talking about. &lt;p&gt;Before Vista was released, there were a lot of questions about just what advantage the DWM (Desktop Window Manager) would bring over User and GDI. There were even comparisons between the DWM and the windowing system for MacOS (sorry I don't know the name, I'm not a Mac programmer). To be honest there is no comparison. The DWM uses a retained model for graphics. What this means is that a window is asked to render itself once and the DWM stores the visual until the application tells it that it's visual is invalid. &lt;p&gt;For the average application developer, this doesn't bring a big advantage. But anyone who has made a custom control (pre-WPF) can appreciate not having to write additional code that re-renders the rectangle  that was covered by a dialog. Basically, telling Windows that you want to update what the user sees is a lot easier to do than having Windows tell you that you need to update. &lt;p&gt;The end user of course benefits from this as well. And not just in the eye candy department (but if you think it doesn't matter, it does). Because the DWM retains the raw graphics calls that your window made to render itself, it can put those in a place that makes sense, like the ram of the video card. Think about it. The operating system itself leverages the power of your GPU. This translates into less strain on the CPU, which makes the operating system (and hence your app) more responsive. For free. &lt;p&gt;Knowing more about the DWM should help one get a better understanding of just what WPF is. It is a .Net wrapper around the first Windows API that was designed with .Net as a consideration. (User and GDI were created well before .Net was conceived.) To learn more about the DWM, visit this old post by &lt;a href="http://blogs.msdn.com/greg_schechter/archive/2006/03/05/544314.aspx" target="_blank"&gt;Greg Schechter&lt;/a&gt;. He might know a tiny bit more about it than I.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+So+this+is+Vista&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!544.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!544.entry</guid><pubDate>Thu, 13 Sep 2007 16:44:02 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!544/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!544.entry#comment</wfw:comment><dcterms:modified>2007-09-13T16:56:47Z</dcterms:modified></item><item><title>Attached Properties, Markup Extensions, and MultiBindings...Oh My!</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!325.entry</link><description>&lt;p&gt;So, I've touted the advantages of Attached Dependency Properties extensively in the forums. One of my favorite uses of Attached Properties is the fact that you can use them to attach additional functionality to an object -- named the &lt;a href="http://blogs.msdn.com/bencon/archive/2006/07/26/more-advanced-attached-property-use-the-ramora-pattern.aspx" target="_blank"&gt;Remora Pattern by Ben Constable&lt;/a&gt;. Technically, I think it's a bit of a misnomer because a &lt;a href="http://en.wikipedia.org/wiki/Remora" target="_blank"&gt;Remora&lt;/a&gt; doesn't provide any benefit to its host...it doesn't harm it, but it definitely doesn't provide any benefit. So, after a quick search through wikipedia for &lt;a href="http://en.wikipedia.org/wiki/Mutualism" target="_blank"&gt;mutually beneficial symbiosis&lt;/a&gt;, I found the &lt;a href="http://en.wikipedia.org/wiki/Egyptian_Plover" target="_blank"&gt;Egyptian Plover&lt;/a&gt;, also known as the crocodile bird. The plover eats parasites off of the crocodile, providing it relief from pests. In exchange, the Plover gets a veritable smorgasbord and the safest home in the Nile. Although the name remora does a good job at getting the idea of &amp;quot;attaching&amp;quot; across, it doesn't do so well with the idea of enhancement, which is what the pattern does. However, once a pattern is named, for consistency sake, we should stick to that name. Is this technically a pattern? I can think of three instances where it could be useful, beyond the one named by Ben in his blog. 
&lt;p&gt;The first example I will provide is the infamous &lt;a href="http://www.sitechno.com/Blog/HowToUseAttachedPropertiesAsAnExtensionMechanismForACheckedListbox.aspx"&gt;Multiselect question&lt;/a&gt;: how do I select all checkboxes similar to an email client allowing a user to select all of his spam for deletion with one check. Yes, I know I just linked to an example of using attached properties to perform this very task, but I use a slightly different approach that lets me demonstrate a few more neat WPF tricks. 
&lt;p&gt;First we're going to need a source object that tells us whether all the checkboxes should be checked or unchecked. Let's call it a MultiSelectionSource. Our source needs to be a DependencyObject and should expose whether or not it's selected as a boolean dependency property 
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;    &lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; &lt;/span&gt;&lt;span style="color:gray"&gt;&lt;/span&gt;&lt;br&gt;    &lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Dummy object that acts as a source for &lt;/span&gt;&lt;span style="color:gray"&gt;&lt;/span&gt;&lt;span style="color:green"&gt;s.&lt;/span&gt; &lt;br&gt;    &lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; &lt;/span&gt;&lt;span style="color:gray"&gt;&lt;/span&gt;&lt;br&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;MultiSelectionSource&lt;/span&gt; : &lt;span style="color:teal"&gt;DependencyObject&lt;/span&gt; &lt;br&gt;    { &lt;br&gt;        &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:teal"&gt;Boolean&lt;/span&gt; IsSelected &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; (&lt;span style="color:teal"&gt;Boolean&lt;/span&gt;)GetValue(IsSelectedProperty); } &lt;br&gt;            &lt;span style="color:blue"&gt;set&lt;/span&gt; { SetValue(IsSelectedProperty, &lt;span style="color:blue"&gt;value&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;static&lt;/span&gt; &lt;span style="color:blue"&gt;readonly&lt;/span&gt; &lt;span style="color:teal"&gt;DependencyProperty&lt;/span&gt; IsSelectedProperty = &lt;br&gt;            &lt;span style="color:teal"&gt;DependencyProperty&lt;/span&gt;.Register( &lt;br&gt;                &lt;span style="color:maroon"&gt;&amp;quot;IsSelected&amp;quot;&lt;/span&gt;, &lt;br&gt;                &lt;span style="color:blue"&gt;typeof&lt;/span&gt;(&lt;span style="color:teal"&gt;Boolean&lt;/span&gt;), &lt;br&gt;                &lt;span style="color:blue"&gt;typeof&lt;/span&gt;(&lt;span style="color:teal"&gt;MultiSelectionSource&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;true&lt;/span&gt;));&lt;/div&gt;
&lt;p&gt;Now we should be able to declare an instance of our MultiSelectionSource as a resource in our Window/UserControl/FrameworkElement and bind our checkboxes IsChecked property to IsSelected right? Not so fast! If we bind our CheckBoxes to IsSelected, then they are either all checked or all unchecked. 
&lt;p&gt;And let's not forget the importance of the Checkbox...it probably should be binding to a property on our object model (or preferably on our Controller, but that's another post). If they are bound to MultiSelectionSource, then they can't bind to something else. Something else can bind to them...but let's not get into that religious debate. Needless to say we need a way for the MultiSelectionSource to keep track of the Bindings for us. Let's declare a list of Bindings for that purpose. 
&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:teal"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:teal"&gt;BindingBase&lt;/span&gt;&amp;gt; Bindings &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; bindings; } &lt;br&gt;            &lt;span style="color:blue"&gt;set&lt;/span&gt; { bindings = &lt;span style="color:blue"&gt;value&lt;/span&gt;; } &lt;br&gt;        }&lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:teal"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:teal"&gt;BindingBase&lt;/span&gt;&amp;gt; bindings = &lt;span style="color:blue"&gt;new&lt;/span&gt; &lt;span style="color:teal"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:teal"&gt;BindingBase&lt;/span&gt;&amp;gt;();&lt;/div&gt;
&lt;p&gt;Notice that I declared the collection as internal. I could as well have declared it private, no one can access it from XAML. That's not the point. The point is that we have a way to store a collection of Bindings so that the MultiSelectionSource can target the Checkboxes. So how are we going to get the bindings from the Checkboxes to the MultiSelectionSource. If you paid attention to my XML comments, you already saw it coming: with a MultiSelectionTarget. 
&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;MultiSelectionTarget&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;MultiSelectionSource&lt;/span&gt; source; &lt;br&gt;        &lt;span style="color:blue"&gt;public&lt;/span&gt; MultiSelectionTarget(&lt;span style="color:teal"&gt;MultiSelectionSource&lt;/span&gt; source, &lt;span style="color:teal"&gt;String&lt;/span&gt; path) &lt;br&gt;        { &lt;br&gt;            &lt;span style="color:blue"&gt;this&lt;/span&gt;.source = source; &lt;br&gt;            &lt;span style="color:blue"&gt;this&lt;/span&gt;.path = path; &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;p&gt;        &lt;span style="color:blue"&gt;private&lt;/span&gt; &lt;span style="color:teal"&gt;String&lt;/span&gt; path; 
&lt;p&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;/div&gt;
&lt;p&gt; I didn't get around to commenting this guy, sue me. Actually, &lt;strike&gt;&lt;em&gt;the code is the documentation&lt;/em&gt;&lt;/strike&gt; it's really simple your MultiSelectionTarget has a MultiSelectionSource and a String representing its path. It almost looks like a Binding...except it's not.  The Path here represents the path on the target object (such as IsChecked on a Checkbox). And the Source will actually be the Target of the generated Binding. 
&lt;p&gt;So our scenario so far goes thus: 
&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;Hope that helps you...oh wait...how do we do steps 3 and 4, you ask? This is where the &lt;strike&gt;Plover&lt;/strike&gt; Remora Pattern comes into play. But it's past my bedtime, so that will have to wait for later.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Attached+Properties%2c+Markup+Extensions%2c+and+MultiBindings...Oh+My!&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!325.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!325.entry</guid><pubDate>Tue, 08 May 2007 06:25: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!325/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!325.entry#comment</wfw:comment><dcterms:modified>2007-05-08T18:51:11Z</dcterms:modified></item><item><title>Code Climber: Custom Controls (Pt. 1 - The Window)</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!277.entry</link><description>&lt;p&gt;So two post ago I gave a &lt;a href="http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!274.entry" target="_blank"&gt;brief overview of my 4C series&lt;/a&gt;. Unfortunately, after promising to deliver this first entry in the series, I realized that I'm assuming knowledge of WPF development in general. But fear not my fellow coders! Because we are starting at the same place that every Windows programming tutorial before starts: with a simple hello. Indeed, you can consider this a crash course in WPF development itself for new comers, although I would recommend further training before you go full-bore into WPF development (for the patient ones among you, I will be writing a proper series on general WPF development later). 
&lt;p&gt;But before we get to the good stuff we've got to get our development environment ready. Here's what you need: 
&lt;ol&gt;
&lt;li&gt;Windows XP SP2, Server 2003 SP1, or Vista 
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=10CC340B-F857-4A14-83F5-25634C3BF043" target="_blank"&gt;.Net Framework 3.0 RTM&lt;/a&gt; (pre-installed on Vista) 
&lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=7614FE22-8A64-4DFB-AA0C-DB53035F40A0" target="_blank"&gt;Windows Vista SDK&lt;/a&gt; (provides a quick local reference of the .Net 3.0 APIs and support for compiling .Net 3.0 apps) 
&lt;li&gt;(optional) &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=B2C27A7F-D875-47D5-B226-E2578A116E12&amp;amp;displaylang=en" target="_blank"&gt;Visual Studio 2005&lt;/a&gt; Professional or better. (I'd highly recommend downloading the trial if you don't have a copy. Express won't support integrated WPF development) 
&lt;li&gt;(optional) &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=F54F5537-CC86-4BF5-AE44-F5A1E805680D&amp;amp;displaylang=en" target="_blank"&gt;Visual Studio Extensions for WPF and WCF November CTP&lt;/a&gt; (provides additional support for WPF development within the Visual Studio 2005 IDE and integrates the Windows Vista SDK into the MSDN Library if installed) 
&lt;li&gt;Of course for a really cutting edge experience, you can &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=CF76FCBA-07AF-47AC-8822-4AD346210670&amp;amp;displaylang=en" target="_blank"&gt;download the latest &amp;quot;Orcas&amp;quot; CTP&lt;/a&gt; which provides the most integrated .Net 3.0 developer experience available today.&lt;/ol&gt;
&lt;p&gt;Although, Visual Studio 2005 and the VS Extensions are marked as optional, it is out of this series' scope to provide instruction on building WPF applications from the command line. I would feel bad about this except there is a free three month trial available for those following along (just click the link). Anyway, I'm going to take a quick break while you get everything set up for what comes next. 
&lt;p&gt;All done? Great! One more quick note, for the first version of this tutorial, I will only be providing code samples in C# and XAML. If I get enough requests, I will take the time to convert it to VB.Net as well. So on to the good stuff. 
&lt;p&gt;The first step is simple: create a new project in Visual Studio. If this is your first time using the extensions for WPF, you will see a new set of options for .Net 3.0 projects 
&lt;p&gt;&lt;a href="http://tkfiles.storage.msn.com/x1pWZZh3TCHCz7UmFEi6pSRT-qwKhLrSHcR_o9fpTuF_xYcs2hS_-NuE17hC_19Y5nSalaK8vTacwWnKNOWGJ0u5xumu3jyZ6h7HlFu9HBRwx8"&gt;&lt;img height=451 alt="The new project dialog after installing .Net 3.0 support." src="http://blu1.storage.msn.com/x1pdLXRxRjWnrBgDlavYdOC4qIC1ORdBz3yFFlNke-GMu6Nb_JUloyYnTRfXv-F7PRtrp-BIFITaiSLMIxeTAi1TJIG5ihQHS-4pOeXaaQ42CZLRmz_B-54ZhoWs2_zfkcPpRhdJGWgRFVKsIgWVTwthQ" width=640&gt;&lt;/a&gt; 
&lt;p&gt;Select the Windows Application (WPF) template and fill out the rest of the dialog as shown (you can select whatever location suits you best). After you hit okay, the base template for a WPF application will be created. You should see the following in your solution explorer: 
&lt;p&gt;&lt;a href="http://blu1.storage.msn.com/x1pdLXRxRjWnrBgDlavYdOC4qIC1ORdBz3yFFlNke-GMu75t3wwLKe5UtqR6WsE0MRAK8h_hQP66v9VPGBbCMM-MRCvypVMiRxFR4iHRE9t2CntTcAP5MHgiepHZfy6T1-zVQXSqVkV7P-7h_LGHLz-3Q"&gt;&lt;img height=480 src="http://blu1.storage.msn.com/x1pdLXRxRjWnrBgDlavYdOC4qIC1ORdBz3yFFlNke-GMu6WUessosPZM22UchLlFxu36k0s19S75rMXZaM40IN0tmiarRquAAmN2GRZ08vixzm7XdtYmB3gHbSM0F_3lnzsX9VN7sw5fFb6LG-QFJgeFA" width=223 align=left&gt;&lt;/a&gt; 
&lt;p&gt;The default WPF Windows app includes references to the most common WPF libraries that an app might need. It also contains two XAML files and their &amp;quot;code-behinds&amp;quot;. The first XAML file and its code-behind defines a custom subclass of &lt;a href="http://msdn2.microsoft.com/en-gb/library/system.windows.application.aspx" target="_blank"&gt;System.Windows.Application.&lt;/a&gt; The Application class provides all of the global application-level plumbing (just like the Winforms Application before it). 
&lt;p&gt;In addition to the Application definition, the project template includes a definition for a sublcass of &lt;a href="http://msdn2.microsoft.com/en-gb/library/system.windows.window.aspx" target="_blank"&gt;System.Windows.Window&lt;/a&gt; in a XAML file (Window1.xaml) and its corresponding code-behind. 
&lt;p&gt;As I mentioned before, XAML is an XML-based markup language that is used by .Net Framework 3.0 to declare and instantiate CLR objects. WPF uses XAML to define UI, while Windows Workflow uses XAML to define...well workflows (or so I am told, I haven't worked much with it as of now). In order to expose as much UI capability as possible with as much simplicity as possible, a new framework was needed that gives easy access to everything from basic graphic primitives (normally accessed by GDI/GDI+ calls) through media playback (normally requiring DirectX or WindowsMedia knowledge) and including the controls we all know and love from Windows Forms (well most of them that is). 
&lt;p&gt;For a developer who has not had prior exposure to a Markup/Code-behind model (similar to what ASP.Net uses), WPF applications that use XAML may be a bit disconcerting at first. But it may be easier to come to terms with it if one were to compare it to a partial class. The XAML defines certain parts of the class (the UI in most cases) and is eventually compiled behind the scenes, while the C# defines the logic that listens for events on the UI and responds accordingly (MVC at its finest). 
&lt;p&gt;Again this is very similar to the programming model for ASP.Net. The UI (web page) is defined declaratively using an XML-based language. While the logic resides in a code-behind that listens for events on the UI and responds accordingly. The similarities don't end there, but that's for another entry. 
&lt;p&gt;I guess at this point, there's only so much that can be conveyed without a code sample. So here it is the XAML and code-behind that define the App class for HelloWorld.&lt;br&gt;&lt;br&gt;&lt;br&gt;
&lt;p&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;&lt;span style="color:#2b91af"&gt;    1&lt;/span&gt; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Application&lt;/span&gt;&lt;span style="color: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;WPFTutorial.HelloWorld.App&lt;/span&gt;&amp;quot; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    2&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/winfx/2006/xaml/presentation&lt;/span&gt;&amp;quot; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    3&lt;/span&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:#2b91af"&gt;    4&lt;/span&gt; &lt;span style="color:blue"&gt;    &lt;/span&gt;&lt;span style="color:red"&gt;StartupUri&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Window1.xaml&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    5&lt;/span&gt; &lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Application.Resources&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    6&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;    7&lt;/span&gt; &lt;span style="color:blue"&gt;    &amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:#a31515"&gt;Application.Resources&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    8&lt;/span&gt; &lt;span style="color:blue"&gt;&amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:#a31515"&gt;Application&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;i&gt;App.Xaml&lt;/i&gt; 
&lt;p&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;&lt;span style="color:#2b91af"&gt;    1&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    2&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Windows; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    3&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Data; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    4&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Xml; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    5&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Configuration; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    6&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;    7&lt;/span&gt; &lt;span style="color:blue"&gt;namespace&lt;/span&gt; WPFTutorial.HelloWorld &lt;br&gt;&lt;span style="color:#2b91af"&gt;    8&lt;/span&gt; { &lt;br&gt;&lt;span style="color:#2b91af"&gt;    9&lt;/span&gt;     &lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; &lt;/span&gt;&lt;span style="color:gray"&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:#2b91af"&gt;   10&lt;/span&gt;     &lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Interaction logic for App.xaml&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   11&lt;/span&gt;     &lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; &lt;/span&gt;&lt;span style="color:gray"&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:#2b91af"&gt;   12&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;   13&lt;/span&gt;     &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;partial&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;App&lt;/span&gt; : System.Windows.&lt;span style="color:#2b91af"&gt;Application&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   14&lt;/span&gt;     { &lt;br&gt;&lt;span style="color:#2b91af"&gt;   15&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;   16&lt;/span&gt;     } &lt;br&gt;&lt;span style="color:#2b91af"&gt;   17&lt;/span&gt; }&lt;/div&gt;&lt;font color="#000000"&gt;&lt;i&gt;App.Xaml.cs&lt;/i&gt; &lt;/font&gt;
&lt;p&gt;&lt;font color="#000000"&gt;So what did we do here? Let's look line by line starting with App.Xaml. In line 1, we see the root element, Application. Each element within a XAML file tells the compiler to create an instance of the class that the element represents. The classes are matched to elements through special CLR namespace to XML Namespace mapping. This can be done either through a special assembly-level CLR Attribute (&lt;/font&gt;&lt;a href="https://msdn2.microsoft.com/en-us/library/system.windows.markup.xmlnsdefinitionattribute.aspx" target="_blank"&gt;&lt;font color="#000000"&gt;XmlnsDefinition&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt;), or directly within the XAML using the clr-namespace syntax. There is an &lt;/font&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms747086.aspx" target="_blank"&gt;&lt;font color="#000000"&gt;entire article dedicated&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt; to namespace mapping in the Windows Vista SDK. But to get the jist of it, read on. &lt;/font&gt;
&lt;p&gt;&lt;font color="#000000"&gt;By convention, the default namespace of a WPF XAML file is set to http://schemas.microsoft.com/winfx/2006/xaml/presentation. (The name winfx is a carry-over from the beta days of .NET framework 3.0 when it was called winfx.) This is seen in line 2 of App.xaml. This XML namespace is mapped to the majority of the clr namespaces for WPF using the XmlnsDefinition attribute. Also by convention, the x prefix is set to http://schemas.microsoft.com/winfx/2006/xaml This namespace is mapped to clr namespaces that provide supplementary support to XAML itself (mostly markup extensions). For instance in line 1 we see the x:Class attribute being applied to the Application element. This attributes tells the XAML compiler that WPFTutorial.HelloWorld.App defines a class that extends Application and is what this Application element refers to. This is similar to the Codebehind attribute that you will find on an ASP.NET page or control. &lt;/font&gt;
&lt;p&gt;&lt;font color="#000000"&gt;The default Application isn't too exciting. However, if you look at line 4 of app.xaml, you will see the StartupUri attribute with a value of Window1.xaml. This attribute maps directly to the StartupUri property of Application. This property tells the application what will be displayed first (similar to passing a Form to Application.Run in the WinForms world). &lt;/font&gt;
&lt;p&gt;&lt;font color="#000000"&gt;There is a lot more that can be done with your application's Application. There are event handlers to hook into, properties to set, the whole nine yards. We're not going to go into depth on that here. The point of showing it here was to give you, dear reader, knowledge of its existence. Its up to you to determine how best to use the tool in your arsenal. &lt;/font&gt;
&lt;p&gt;&lt;font color="#000000"&gt;On to the fun stuff! Here is the code for Window1: &lt;/font&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;&lt;span style="color:#2b91af"&gt;    1&lt;/span&gt; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Window&lt;/span&gt;&lt;span style="color: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;WPFTutorial.HelloWorld.Window1&lt;/span&gt;&amp;quot; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    2&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/winfx/2006/xaml/presentation&lt;/span&gt;&amp;quot; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    3&lt;/span&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:#2b91af"&gt;    4&lt;/span&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;WPFTutorial.HelloWorld&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;600&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;800&lt;/span&gt;&amp;quot; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    5&lt;/span&gt; &lt;span style="color:blue"&gt;    &amp;gt;&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    6&lt;/span&gt; &lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    7&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;    8&lt;/span&gt; &lt;span style="color:blue"&gt;    &amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:#a31515"&gt;Grid&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    9&lt;/span&gt; &lt;span style="color:blue"&gt;&amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:#a31515"&gt;Window&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;i&gt;&lt;font color="#000000"&gt;Window1.xaml&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/i&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;&lt;span style="color:#2b91af"&gt;    1&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    2&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Collections.Generic; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    3&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Text; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    4&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Windows; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    5&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Windows.Controls; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    6&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Windows.Data; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    7&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Windows.Documents; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    8&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Windows.Input; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    9&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Windows.Media; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   10&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Windows.Media.Imaging; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   11&lt;/span&gt; &lt;span style="color:blue"&gt;using&lt;/span&gt; System.Windows.Shapes; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   12&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;   13&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;   14&lt;/span&gt; &lt;span style="color:blue"&gt;namespace&lt;/span&gt; WPFTutorial.HelloWorld &lt;br&gt;&lt;span style="color:#2b91af"&gt;   15&lt;/span&gt; { &lt;br&gt;&lt;span style="color:#2b91af"&gt;   16&lt;/span&gt;     &lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; &lt;/span&gt;&lt;span style="color:gray"&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:#2b91af"&gt;   17&lt;/span&gt;     &lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; Interaction logic for Window1.xaml&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   18&lt;/span&gt;     &lt;span style="color:gray"&gt;///&lt;/span&gt;&lt;span style="color:green"&gt; &lt;/span&gt;&lt;span style="color:gray"&gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color:#2b91af"&gt;   19&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;   20&lt;/span&gt;     &lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;partial&lt;/span&gt; &lt;span style="color:blue"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Window1&lt;/span&gt; : System.Windows.&lt;span style="color:#2b91af"&gt;Window&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   21&lt;/span&gt;     { &lt;br&gt;&lt;span style="color:#2b91af"&gt;   22&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;   23&lt;/span&gt;         &lt;span style="color:blue"&gt;public&lt;/span&gt; Window1() &lt;br&gt;&lt;span style="color:#2b91af"&gt;   24&lt;/span&gt;         { &lt;br&gt;&lt;span style="color:#2b91af"&gt;   25&lt;/span&gt;             InitializeComponent(); &lt;br&gt;&lt;span style="color:#2b91af"&gt;   26&lt;/span&gt;         } &lt;br&gt;&lt;span style="color:#2b91af"&gt;   27&lt;/span&gt;  &lt;br&gt;&lt;span style="color:#2b91af"&gt;   28&lt;/span&gt;     } &lt;br&gt;&lt;span style="color:#2b91af"&gt;   29&lt;/span&gt; }&lt;/div&gt;&lt;font color="#000000"&gt;&lt;i&gt;Window1.xaml.cs&lt;/i&gt; &lt;/font&gt;
&lt;p&gt;&lt;font color="#000000"&gt;Again, the code doesn't do much and if you ran this application, you'd get a blank window. The XAML for this window is quite simple, consisting of two elements the Window itself and its child, a Grid. A Window can only have one direct child. That child is usually a descendant of Panel. However it can be a Button, a TextBlock, or whatever you want it to be. For some developers, the Window is the only control they will customize by composition (I.E. adding other controls to the window). &lt;/font&gt;
&lt;p&gt;&lt;font color="#000000"&gt;Let's wrap this overview of the window in classic fashion. We'll add some text to our window to say hello. Open up Window1.xaml and within the Grid element add the following: &lt;/font&gt;
&lt;p&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new"&gt;
&lt;p&gt;&lt;span style="color:#2b91af"&gt;    7&lt;/span&gt; &lt;span style="color:blue"&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    8&lt;/span&gt; &lt;span style="color:blue"&gt;      &lt;/span&gt;&lt;span style="color:red"&gt;FontSize&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;50&lt;/span&gt;&amp;quot; &lt;br&gt;&lt;span style="color:#2b91af"&gt;    9&lt;/span&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;br&gt;&lt;span style="color:#2b91af"&gt;   10&lt;/span&gt; &lt;span style="color:blue"&gt;      &lt;/span&gt;&lt;span style="color:red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Center&lt;/span&gt;&amp;quot; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   11&lt;/span&gt; &lt;span style="color:blue"&gt;      &lt;/span&gt;&lt;span style="color:red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Center&lt;/span&gt;&amp;quot; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   12&lt;/span&gt; &lt;span style="color:blue"&gt;      &lt;/span&gt;&lt;span style="color:red"&gt;TextWrapping&lt;/span&gt;&lt;span style="color:blue"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;Wrap&lt;/span&gt;&amp;quot;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt; &lt;br&gt;&lt;span style="color:#2b91af"&gt;   13&lt;/span&gt;       Hello World From WPF! &lt;br&gt;&lt;span style="color:#2b91af"&gt;   14&lt;/span&gt; &lt;span style="color:blue"&gt;    &amp;lt;/&amp;lt; span&amp;gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;We now have a window that greets us like so:&lt;/font&gt;&lt;a href="http://blu1.storage.msn.com/x1pdLXRxRjWnrBgDlavYdOC4qIC1ORdBz3yFFlNke-GMu6q5MfEZ2Zzc4esmTc-Usme82VqxY_1Ez4R3_a7ed2qOQPkJCkfXM98ywl_cLHBe4GxM1cIwQIGq_ysaAIvJxt2aH3mwsUTpOgbTOjDlXSyhdaV3LdePtWW"&gt;&lt;font color="#000000"&gt;&lt;img height=480 src="http://blu1.storage.msn.com/x1pdLXRxRjWnrBgDlavYdOC4qIC1ORdBz3yFFlNke-GMu7cvnH10n7OE06YSDLF10VQEXwrTVfl0FiGLxwtA66HySh5hSw8jie35VnCBCEtir82J3Vl-8-bYkeJxPt9C2MvFE4WCuKI9eqr84Ldttd7Ymb89776hQPH" width=640&gt;&lt;/font&gt;&lt;/a&gt;&lt;font color="#000000"&gt; &lt;/font&gt;
&lt;p&gt;&lt;font color="#000000"&gt;So that's it! You've made your first custom WPF control. This actually turned more into a WPF first steps tutorial, but it was also necessary to help give a solid foundation into what a control is in WPF and how it can be customized.&lt;/font&gt;
&lt;p&gt;Up next! The UserControl.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Code+Climber%3a+Custom+Controls+(Pt.+1+-+The+Window)&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!277.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!277.entry</guid><pubDate>Sun, 06 May 2007 01:49: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!277/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!277.entry#comment</wfw:comment><dcterms:modified>2007-05-06T03:02:58Z</dcterms:modified></item><item><title>Code Climber: Custom Controls (Pt. 0 - WPF Meet World)</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!278.entry</link><description>&lt;p&gt;So I was writing my first entry in the 4C series when it came to me: I don't think I've given a proper introduction to WPF. Well at least not since it was fully released.  Although there are a million places one could go to get a quick overview. I figured it wouldn't hurt to make that a million and one. So without further ado, I give you my dear reader: &lt;h1&gt;A No-Holds-Barred Marketing Free Overview of WPF&lt;/h1&gt; &lt;p&gt;What is WPF? It is a simple question, but the evidence suggests that it is not such a simple answer. On the official &lt;a href="http://wpf.netfx3.com/" target="_blank"&gt;WPF Community Site&lt;/a&gt;, Microsoft provides a &lt;a href="http://wpf.netfx3.com/files/folders/presentations/default.aspx" target="_blank"&gt;WPF overview presentation&lt;/a&gt; in four varieties 1, 3, and 5 slide, and 1 hour. Here's the simple synopsis: the Windows Presentation Foundation is a framework that provides support for the presentation layer of a Windows application.  &lt;p&gt;Yes I know what you're thinking: doesn't Windows Forms already provide a full day's supply of my application's UI needs? Well yes and no. There are many applications that can do just fine with what windows forms provides. But there are definitely more capabilities of Windows that can fall under the &amp;quot;presentation&amp;quot; umbrella other than forms, buttons, labels, and textboxes. In order to tap into those other capabilities, a developer needed familiarity with other APIs like DirectX and GDI+. This led to a lot of the rich visualization that Windows is capable of not being used by line of business app developers who, rather than taking the time to learn and utilize complex frameworks, felt their efforts would be better put to use in creating functionality rather than &amp;quot;prettying&amp;quot; up their UI. WPF takes the power normally wielded by DirectX and GDI specialists and makes it more accessible. &lt;p&gt;Okay, maybe that wasn't as marketing free as I anticipated. At least I didn't use &amp;quot;paradigm&amp;quot; or &amp;quot;ROI&amp;quot; or &amp;quot;TCO&amp;quot;. Essentially WPF takes all of the disparate Windows APIs that could be used as part of an applications presentation and puts them in a single package. And that package just happens to be at the center of the new .Net Framework. Microsoft highlights the importance of WPF by starting its packages with System.Windows (whereas the Winforms packages begin with System.Windows.Forms).  &lt;p&gt;In addition to the new framework, Microsoft has provided a new XML-based language (yes it's an eXtended Markup Language based Language) called XAML (eXtensible Application Markup Language). That's fine and dandy, but to top it off Microsoft created a compiler that can interpret XAML and create runtime objects from it. XAML can be used by itself or with a code-behind (partial class to be precise) that serves the same purpose as an ASP.Net code-behind: handling events generated by the XAML using imperative code. &lt;h1&gt;So What Does This Mean for Me?&lt;/h1&gt; &lt;h1&gt;&lt;/h1&gt; &lt;p&gt;There are several significant points here: &lt;ol&gt; &lt;li&gt;WPF makes advanced presentation technologies easier to access. &lt;li&gt;XAML provides a method to declaratively layout a desktop interface (similar to HTML for web apps). &lt;li&gt;XAML layout can be separated from general application coding allowing designers to design the UI while developers code the logic. &lt;li&gt;Line of Business desktop apps can now take advantage of rich visualization without compromising functionality. &lt;li&gt;You get to take advantage of a new Paradigm in windows development that can increase your company's ROI and lower the TCO over the life of the application. (Sorry...had to let my inner marketer out for a second).&lt;/ol&gt; &lt;p&gt;Now that I've given a VERY high-level overview, let's get to the good stuff. Up next...the Window.&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Code+Climber%3a+Custom+Controls+(Pt.+0+-+WPF+Meet+World)&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!278.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!278.entry</guid><pubDate>Mon, 12 Feb 2007 07:23:36 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!278/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!278.entry#comment</wfw:comment><dcterms:modified>2007-02-12T07:23:36Z</dcterms:modified></item><item><title>As if you didn't already know...</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!214.entry</link><description>&lt;div&gt;.Net Framework 3.0 has RTM'd (and is available on subscriber downloads). &lt;strong&gt;FINALLY&lt;/strong&gt; I can stop uninstalling/reinstalling the latest Beta/CTP/RC version. Maybe I'll re-image my workstation to make sure that it can breath.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Also of note is that Office 2007 has RTM'd as well. I JUST put the Beta 2 Tech Refresh on my machine (I'm loving the new logos), but since I'm doing a re-image anyway, why not drop the final version on there as well?&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now if I can get through the rest of this project, I might have some time to go back to tinkering with WPF!&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+As+if+you+didn't+already+know...&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!214.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!214.entry</guid><pubDate>Tue, 07 Nov 2006 21:48:38 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!214/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!214.entry#comment</wfw:comment><dcterms:modified>2006-11-07T21:48:38Z</dcterms:modified></item><item><title>WPF Navigation: The Basics</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!155.entry</link><description>&lt;div&gt;
&lt;div&gt;Remember how I compared WPF programming to ASP.Net development. Well the comparison goes separating UI design and logic development. Just like web applications, WPF applications can navigate from page to page. Also like a web application, navigation pages can occupy the entire window or a designated frame on that window.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;What benefit does this bring?&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;If you think of a Dashboard application, the primary functionality is presenting data. The main window can be a series of links to the various reports that are of interest to the user. What's more, the dashboard can be embedded in a larger app that provides more functionality. The real beauty of it all is that the pages of the dashboard do not have to care about whether they are embedded or not. All they have to worry abut is showing their data. And just like a web application all it takes is a hyperlink to move from page to page.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;But if you want to get beyond just showing data and actually want to collect data from your users, all but the simplest of tasks would create a messy web of dependency between your pages.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;That is where structured navigation and PageFunctions come into play. But I'm getting ahead of myself. We'll learn about that in the next entry.&lt;/div&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+WPF+Navigation%3a+The+Basics&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!155.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!155.entry</guid><pubDate>Mon, 24 Jul 2006 06:11:48 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!155/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!155.entry#comment</wfw:comment><dcterms:modified>2006-07-24T06:11:48Z</dcterms:modified></item><item><title>Documentation Almost There</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!151.entry</link><description>&lt;div&gt;When I first started learning WPF, the documentation was in its infancy. Thus, I did most of my learning by reading blogs, looking at samples, and tinkering. Well I decided to really sit down with the documentation provided with the June CTP and I must confess that it is quite impressive. The dreaded learning cliff of WPF programming (that the majority of early adopters had to scale) has been tamed. Want to learn about WPF, open up the docs and start reading.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;With the upcoming books from Charles Petzold and company, there will be plenty of material to help the new comers get a handle on WPF development. Of course they will miss all the fun of blazing a new trail, but I guess it's not for everyone.&lt;img src="rte/emoticons/smile_wink.gif"&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Documentation+Almost+There&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!151.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!151.entry</guid><pubDate>Sat, 22 Jul 2006 09:09:25 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!151/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!151.entry#comment</wfw:comment><dcterms:modified>2006-07-22T09:09:25Z</dcterms:modified></item><item><title>IErrorProvider in WPF</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!148.entry</link><description>&lt;div&gt;Not too long ago, &lt;a href="http://www.paulstovell.net/"&gt;Paul Stovell&lt;/a&gt;, a fellow WPF apprentice asked if there was a way to get a list of all bindings in a control on the &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=572850&amp;amp;SiteID=1&amp;amp;mode=1"&gt;WPF forums&lt;/a&gt;. After a little bit of diving into the documentation, I found the LogicalTreeHelper, a helper class that you can use to walk the logical tree of a control. (Combining that with reflection allowed him to get the bindings). Paul wanted to use this functionality for his implementation of&lt;a href="http://www.codeproject.com/winfx/wpfErrorProvider.asp"&gt; IErrorProvider for WPF&lt;/a&gt;. Today I stumbled across the ValidationRule class that provides similar functionality to what IErrorProvider did. &lt;a href="http://www.beacosta.com"&gt;Bea Costa&lt;/a&gt;, WPF DataBinding guru extraordinaire, has a blog entry (look under the March 2006 archives) in which she shows its usage.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+IErrorProvider+in+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!148.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!148.entry</guid><pubDate>Sat, 22 Jul 2006 09:01:13 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!148/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!148.entry#comment</wfw:comment><dcterms:modified>2006-07-22T09:01:13Z</dcterms:modified></item><item><title>Growing Pains</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!145.entry</link><description>&lt;div&gt;
&lt;div&gt;So I finally upgraded my machine to the June CTP of .NetFX3 and found my code was broken.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Basically it was complaining that an ObservableCollection in my control was null during initialization. In Beta 2 it would just initialize my collection for me. Before this code would work&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;blockquote dir=ltr&gt;
&lt;div&gt;&amp;lt;tempNS:MyControl&amp;gt;&lt;/div&gt;
&lt;div&gt;   &amp;lt;tempNS:MyControl.MyCollection&amp;gt;&lt;/div&gt;
&lt;div&gt;        &amp;lt;tempNS:MyCollectionItem ..../&amp;gt;&lt;/div&gt;
&lt;div&gt;        &amp;lt;tempNS:MyCollectionItem ..../&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;        &amp;lt;tempNS:MyCollectionItem ..../&amp;gt;&lt;/div&gt;
&lt;div&gt;   &amp;lt;/tempNS:MyControl.MyCollection&amp;gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;/tempNS:MyControl&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;div dir=ltr&gt;Now I have to explicitly declare the new collection like so:&lt;/div&gt;
&lt;blockquote dir=ltr&gt;
&lt;div&gt;&amp;lt;tempNS:MyControl&amp;gt;&lt;/div&gt;
&lt;div&gt;   &amp;lt;tempNS:MyControl.Collection&amp;gt;&lt;/div&gt;
&lt;div&gt;      &amp;lt;tempNS:MyCollection&amp;gt;&lt;/div&gt;
&lt;div&gt;        &amp;lt;tempNS:MyCollectionItem ..../&amp;gt;&lt;/div&gt;
&lt;div&gt;        &amp;lt;tempNS:MyCollectionItem ..../&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;        &amp;lt;tempNS:MyCollectionItem ..../&amp;gt;&lt;/div&gt;
&lt;div&gt;      &amp;lt;/tempNS:MyCollection&amp;gt;&lt;/div&gt;
&lt;div&gt;  &amp;lt;/tempNS:MyControl.MyCollection&amp;gt;&lt;/div&gt;
&lt;div&gt;&amp;lt;/tempNS:MyControl&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p dir=ltr&gt;I was wondering why it happened and got my answer &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=537019&amp;amp;SiteID=1"&gt;here&lt;/a&gt; . Basically, the framework used to initialize collections for you (if they weren't already). But that turned out to be problematic, so they removed the functionality from the framework.
&lt;p dir=ltr&gt;I fixed my problem by initializing the collection within the Control's constructor. I guess that's a growing pain of working with the latest and greatest. I wouldn't have it any other way &lt;img src="http://mbrownchicago.spaces.msn.com/mmm2006-07-07_16.32/rte/emoticons/smile_teeth.gif"&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Growing+Pains&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!145.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!145.entry</guid><pubDate>Thu, 13 Jul 2006 18:34: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!145/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!145.entry#comment</wfw:comment><dcterms:modified>2006-07-13T18:34:16Z</dcterms:modified></item><item><title>Journey to the Past</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!144.entry</link><description>&lt;div&gt;In order to appreciate better what WPF brings to the table, I feel it's necessary for me to learn about its predecessor, GDI+. At the office, we have an amazing library of books related to .Net programming, software architecture, mathmatics, basically anything that will assist us in becoming better at what we do (cranking out software). One book I found in our collection was &lt;a href="http://www.amazon.com/gp/product/159059035X/sr=8-4/qid=1152722795/ref=sr_1_4/103-0099089-0983039?ie=UTF8"&gt;GDI+ Programming in C# and VB.Net&lt;/a&gt;. Although it's not the most recent book in the world (published in 2002), it is a pretty encompassing text on everything you can do with GDI+ and it even gives some introductory background on how it improves upon GDI (the precursor to GDI+). GDI+ is essentially a .Net wrapper around GDI that adds the power of object-oriented programming to a procedural API.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;From the first example, the author (Nick Symmonds) shows how GDI+ simplifies the task of drawing a line from six steps in GDI to three in GDI+. It truly is as dramatic as going from creating a form based application using the Win32 API to developing in Winforms. WPF is a similar leap in terms of ease of development (once you get past its learning curve).&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So my goal is to learn GDI+ and discover what it takes to transistion the skills required for GDI+ programming to WPF. My hope is that this process will make me a stronger WPF developer.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The other book that I will be referencing is &lt;a href="http://www.amazon.com/gp/product/0596101139/sr=8-1/qid=1152724234/ref=pd_bbs_1/103-0099089-0983039?ie=UTF8"&gt;Programming WPF&lt;/a&gt; by Chris Sells. I will be using that book to learn how to translate GDI+/Winforms code into WPF code. The next post will be my first side by side comparison of GDI+/Winforms development and WPF development.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Journey+to+the+Past&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!144.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!144.entry</guid><pubDate>Wed, 12 Jul 2006 17:14:59 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!144/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!144.entry#comment</wfw:comment><dcterms:modified>2006-07-12T17:14:59Z</dcterms:modified></item><item><title>Why WPF</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!141.entry</link><description>&lt;div&gt;
&lt;div&gt;WPF is an exciting new technology and I will be writing a lot about it in the upcoming days/weeks/months (you get the picture). Before we get into code samples and such. I want to go over why WPF is so exciting.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I'm sure you've been inundated about how Windows Vista is the most dramatic change in Windows PC computing since the release of Windows 95. Although, the PR people will quickly emphasize that Vista is much more than just a new pretty UI (they are right), it would be a mistake to overlook the fact that the graphics subsystems in Vista are major improvements over previous iterations. I won't go into details here, but if you'd like to know more, a good place to start is &lt;a href="http://blogs.msdn.com/greg_schechter/default.aspx"&gt;&lt;u&gt;&lt;font color="#800080"&gt;Greg Schechter's Blog&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;. Suffice it to say that the possibilities it creates are exciting.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So let's answer the question on everyone's mind. &lt;strong&gt;What's so big about WPF?&lt;/strong&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;XAML (rhymes with Camel)
&lt;li&gt;Ummm...there is no 2. XAML is the big thing about WPF.
&lt;li&gt;Actually, I lied there is a number two and several points after but they all point back to 1.
&lt;li&gt;Okay that's wrong too there are other highlights in WPF that aren't directly tied to XAML but they are a bit more technical than I care to go into now. (Again, I'll point you to Greg Schechter for more technical discussions.)&lt;/ol&gt;
&lt;p&gt;XAML or eXtensible Application Markup Language, is basically the representation of UI in XML. XAML brings the power of declarative UI programming to Windows desktop applications. I say desktop applications because ASP.Net apps already have a similar feature called html.
&lt;p&gt;One major feature of ASP.Net development is that logic is CLEARLY separated from presentation. Well it is possible to have scriptlets of logic within an ASP.Net page and to imperatively create HTML elements in a code-behind file; but for the most part ASP.Net supports a model of separation, leaving UI Design to designers and business logic to coders.
&lt;p&gt;WPF gives desktop applications a similar development model with XAML. Of course, a developer is free to create his (or her) WPF application using all imperative code. He would also be free to create his web app using only ISAPI.
&lt;p&gt;This is the big deal regarding WPF. For the first time, designers can create their mockups using a tool that is targeted toward designers (namely &lt;a href="http://www.microsoft.com/products/expression/en/interactive_designer/default.mspx"&gt;Expression Interactive Designer&lt;/a&gt;) and have it immediately useful for developers. The reverse is also true. Developers can create a basic UI for their application in Visual Studio and a designer can use the same files to enhance the UI in Expression. Gone are the days of designers creating mockups in a graphics tool and developers having to translate that look into a windows form. XAML creates a bridge between developers and designers that simply did not exist before. If you're not excited yet, you should check your pulse.&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Why+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!141.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!141.entry</guid><pubDate>Fri, 07 Jul 2006 15:04:06 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!141/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!141.entry#comment</wfw:comment><dcterms:modified>2006-07-07T15:15:51Z</dcterms:modified></item><item><title>Using WPF Imperatively</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!139.entry</link><description>&lt;div&gt;&lt;font size=2&gt;I bumped into a &lt;/font&gt;&lt;a href="http://www.longhornblogs.com/rrelyea/archive/2005/11/20/Supporting_Code_Scenarios_Well.aspx"&gt;&lt;u&gt;&lt;font color="#800080" size=2&gt;relatively old posting on Rob Relyea's blog&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;font size=2&gt; that talks about the differences between using XAML for your UI and using imperative code (C#, VB). The entry was in response to one in &lt;/font&gt;&lt;a href="http://www.charlespetzold.com/blog/2005/11/190528.html"&gt;&lt;u&gt;&lt;font color="#800080" size=2&gt;Charles Petzold's blog&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;font size=2&gt; where he asks if this disparity was purposeful or accidental.&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size=2&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size=2&gt;I would just have to ask Charles if he has looked at the code generated by the Winforms Designer lately?&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size=2&gt;Let's say I create a form with a DataGridView holding three columns. Here is the generated code for that very simple UI&lt;/font&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;blockquote dir=ltr&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt; &lt;font color="#0000ff"&gt;void&lt;/font&gt; InitializeComponent()&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;{&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.dataGridView1 = &lt;font color="#0000ff"&gt;new&lt;/font&gt; System.Windows.Forms.&lt;font color="#008080"&gt;DataGridView&lt;/font&gt;();&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.Column1 = &lt;font color="#0000ff"&gt;new&lt;/font&gt; System.Windows.Forms.&lt;font color="#008080"&gt;DataGridViewTextBoxColumn&lt;/font&gt;();&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.Column2 = &lt;font color="#0000ff"&gt;new&lt;/font&gt; System.Windows.Forms.&lt;font color="#008080"&gt;DataGridViewTextBoxColumn&lt;/font&gt;();&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.Column3 = &lt;font color="#0000ff"&gt;new&lt;/font&gt; System.Windows.Forms.&lt;font color="#008080"&gt;DataGridViewTextBoxColumn&lt;/font&gt;();&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;  ((System.ComponentModel.&lt;font color="#008080"&gt;ISupportInitialize&lt;/font&gt;)(&lt;font color="#0000ff"&gt;this&lt;/font&gt;.dataGridView1)).BeginInit();&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.SuspendLayout();&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;  // &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;  // dataGridView1&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;  // &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.dataGridView1.AllowUserToAddRows = &lt;font color="#0000ff"&gt;false&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.dataGridView1.AllowUserToDeleteRows = &lt;font color="#0000ff"&gt;false&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.dataGridView1.ColumnHeadersHeightSizeMode =  System.Windows.Forms.&lt;font color="#008080"&gt;DataGridViewColumnHeadersHeightSizeMode&lt;/font&gt;.AutoSize;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.dataGridView1.Columns.AddRange(&lt;font color="#0000ff"&gt;new&lt;/font&gt;  System.Windows.Forms.&lt;font color="#008080"&gt;DataGridViewColumn&lt;/font&gt;[] {&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column1,&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column2,&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column3});&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.dataGridView1.Dock = System.Windows.Forms.&lt;font color="#008080"&gt;DockStyle&lt;/font&gt;.Fill;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.dataGridView1.Location = &lt;font color="#0000ff"&gt;new&lt;/font&gt; System.Drawing.&lt;font color="#008080"&gt;Point&lt;/font&gt;(0, 0);&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.dataGridView1.Name = &lt;font color="#800000"&gt;&amp;quot;dataGridView1&amp;quot;&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.dataGridView1.ReadOnly = &lt;font color="#0000ff"&gt;true&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.dataGridView1.Size = &lt;font color="#0000ff"&gt;new&lt;/font&gt; System.Drawing.&lt;font color="#008080"&gt;Size&lt;/font&gt;(292, 266);&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.dataGridView1.TabIndex = 0;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// Column1&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column1.HeaderText = &lt;font color="#800000"&gt;&amp;quot;Column1&amp;quot;&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column1.Name = &lt;font color="#800000"&gt;&amp;quot;Column1&amp;quot;&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column1.ReadOnly = &lt;font color="#0000ff"&gt;true&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// Column2&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column2.HeaderText = &lt;font color="#800000"&gt;&amp;quot;Column2&amp;quot;&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column2.Name = &lt;font color="#800000"&gt;&amp;quot;Column2&amp;quot;&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column2.ReadOnly = &lt;font color="#0000ff"&gt;true&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// Column3&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column3.HeaderText = &lt;font color="#800000"&gt;&amp;quot;Column3&amp;quot;&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column3.Name = &lt;font color="#800000"&gt;&amp;quot;Column3&amp;quot;&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Column3.ReadOnly = &lt;font color="#0000ff"&gt;true&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// Form1&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#008000"&gt;&lt;font size=2&gt;// &lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.AutoScaleDimensions = &lt;font color="#0000ff"&gt;new&lt;/font&gt; System.Drawing.&lt;font color="#008080"&gt;SizeF&lt;/font&gt;(6F, 13F);&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.AutoScaleMode = System.Windows.Forms.&lt;font color="#008080"&gt;AutoScaleMode&lt;/font&gt;.Font;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.ClientSize = &lt;font color="#0000ff"&gt;new&lt;/font&gt; System.Drawing.&lt;font color="#008080"&gt;Size&lt;/font&gt;(292, 266);&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Controls.Add(&lt;font color="#0000ff"&gt;this&lt;/font&gt;.dataGridView1);&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Name = &lt;font color="#800000"&gt;&amp;quot;Form1&amp;quot;&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;.Text = &lt;font color="#800000"&gt;&amp;quot;Form1&amp;quot;&lt;/font&gt;;&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;((System.ComponentModel.&lt;font color="#008080"&gt;ISupportInitialize&lt;/font&gt;)(&lt;font color="#0000ff"&gt;this&lt;/font&gt;.dataGridView1)).EndInit();&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;&lt;font color="#0000ff"&gt;  this&lt;/font&gt;.ResumeLayout(&lt;font color="#0000ff"&gt;false&lt;/font&gt;);&lt;/font&gt;
&lt;p&gt;&lt;font size=2&gt;}&lt;/font&gt;&lt;/blockquote&gt;
&lt;p dir=ltr&gt;&lt;font size=2&gt;So you see imperative UI code was always verbose. It was just hidden from us by the designer. I guess a case to consider is allowing Cider to generate imperative code as well as XAML...but why?&lt;/font&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Using+WPF+Imperatively&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!139.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!139.entry</guid><pubDate>Sat, 01 Jul 2006 13:31:19 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!139/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!139.entry#comment</wfw:comment><dcterms:modified>2006-07-07T15:10:23Z</dcterms:modified></item><item><title>Arms Race</title><link>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!134.entry</link><description>&lt;div&gt;One of the greatest features of WPF is that it makes Desktop Development accessible to Designers like never before. Although I'm sure you've seen it already, I'd like to point you to Lee Brimelow's &lt;a href="http://www.thewpfblog.com/"&gt;theWPFBlog.com&lt;/a&gt;. Lee comes from a flash background and writes his blog from that perspective. He has a number of examples of how simple WPF makes desktop programming for designers.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Recently, he asked in the &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=119&amp;amp;SiteID=1"&gt;MSDN WPF forums &lt;/a&gt;if it was possible to create a &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=517278&amp;amp;SiteID=1"&gt;glass effect on Windows XP&lt;/a&gt;. I answered that with the &lt;a href="http://laurenlavoie.com/avalon/162"&gt;introduction of transparent windows &lt;/a&gt;in the June CTP, it would be easier than before. I planned to (and still plan to) create an example showing the effect, but before I even got home, Lee had his example up. It took four lines of code in WPF to do this (in Xaml it would have taken one element declaration but who's counting)&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;   this.WindowStyle = WindowStyle.None;&lt;br&gt;   this.AllowsTransparency = true;&lt;br&gt;   this.Title = &amp;quot;Badass Drive Explorer&amp;quot;;&lt;br&gt;   this.Background = new SolidColorBrush(Color.FromArgb(0, 34, 34, 34));&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This code comes from his Window.OnInitialized() function. I know I have an example of creating a translucent window using GDI/GDI+ around here somewhere; but suffice it to say that it's not as simple as this. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now if only there were a technology that made us mere programmers better designers &lt;img src="http://mbrownchicago.spaces.msn.com/mmm2006-06-24_19.45/rte/emoticons/smile_sarcastic.gif"&gt;&lt;br&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=2459489012663404964&amp;page=RSS%3a+Arms+Race&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!134.entry#comment</comments><guid isPermaLink="true">http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!134.entry</guid><pubDate>Fri, 30 Jun 2006 04:49:08 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!134/comments/feed.rss</wfw:commentRss><wfw:comment>http://mbrownchicago.spaces.live.com/Blog/cns!2221DC39E0C749A4!134.entry#comment</wfw:comment><dcterms:modified>2006-07-07T15:10:41Z</dcterms:modified></item></channel></rss>