<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>using System.Windows;</title>
	
	<link>http://www.christopherestep.com</link>
	<description>All things WPF, Silverlight and Windows Phone 7</description>
	<lastBuildDate>Tue, 25 May 2010 13:44:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ChristopherEstep" /><feedburner:info uri="christopherestep" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>ChristopherEstep</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>WPF On Your Shelf: Programming WPF, revisited 3 years later</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/XiJ2QNJYVcQ/</link>
		<comments>http://www.christopherestep.com/2010/05/wpf-on-your-shelf-programming-wpf-revisited-3-years-later/#comments</comments>
		<pubDate>Tue, 25 May 2010 13:44:59 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2010/05/wpf-on-your-shelf-programming-wpf-revisited-3-years-later/</guid>
		<description><![CDATA[<!-- Easy AdSense V2.91 -->
<!-- Post[count: 2] -->
<div class="ezAdsense adsense adsense-leadin" style="float:right;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-3596190094104340";
/* 234x60, created 10/6/09 */
google_ad_slot = "2672587605";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<!-- Easy AdSense V2.91 -->

I have a lot of technical books, particularly on WPF. I have most of the books released by the major publishers on WPF, unless it’s about VB. There are 2 books that are my absolute favorites and the first one is Programming WPF by Chris Sells and Ian Griffiths, published by O’Reilly in 2007. &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I have a lot of technical books, particularly on <a href="http://windowsclient.net">WPF</a>. I have most of the books released by the major publishers on WPF, unless it’s about VB. There are 2 books that are my absolute favorites and the first one is <a href="http://www.amazon.com/gp/product/0596510373?ie=UTF8&amp;tag=systemwindows-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596510373" target="_blank">Programming WPF</a><img style="border-bottom: medium none; border-left: medium none; margin: 0px; border-top: medium none; border-right: medium none" border="0" alt="" src="http://www.assoc-amazon.com/e/ir?t=autismbeautif-20&amp;l=as2&amp;o=1&amp;a=0596510373" width="1" height="1" /> by Chris Sells and Ian Griffiths, published by O’Reilly in 2007.</p>
<p>&#160;</p>
<p><a title="Programming WPF at Amazon.com" href="http://www.amazon.com/gp/product/0596510373?ie=UTF8&amp;tag=systemwindows-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596510373" target="_blank"><img style="border-right-width: 0px; margin: 5px auto; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Programming WPF" border="0" alt="Programming WPF" src="http://www.christopherestep.com/wp-content/uploads/41XH2ONYj1L._SL160_.jpg" width="122" height="213" /></a> </p>
</p>
<p>Why am I reviewing a 3 year old book? It is precisely <strong>because</strong> this book is 3 years old that I’ve chosen to review it now simply because <strong>the book is that good</strong>. Of all of the books that I use, this one has helped me more than any, without question. And it still helps me.&#160; </p>
<p>Yesterday, when I was writing my post <a title="using System.Windows" href="http://www.christopherestep.com/2010/05/wpf-and-the-event-routing-paradigm-with-bacon/">WPF and the Event Routing Paradigm, with Bacon</a>, I went through my books to make sure that I was not only being accurate, but thorough. I wanted not only the conceptual overview and walkthrough, but plenty of technical meat so I could be certain that what I was writing would be truly useful for the people for whom I’ve written it. More importantly, I didn’t want any gaps or omissions.</p>
<p>Many of the books gave only a cursory explanation of Routed Events, something I find to be mindboggling. WPF isn’t easy and Routed Events aren’t intuitive. That’s why I chose the “racing pigs” metaphor. Makes you want to go look, doesn’t it? <img src='http://www.christopherestep.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Of all of the book, only WPF had the technical depth I was looking for.</p>
<h5>But it’s 3 years old!</h5>
<p>So? Yes, we’re at WPF 4 and 3 versions of .NET later (3.5, 3.5 SP1, and 4.0), but the information in Programming WPF is simply that good that it doesn’t really matter. Most of what’s changed in WPF recently have been additions and not breaking changes. The books strength isn’t that it’s on the bleeding edge of technology, it’s that it leaves no stone unturned in what it does cover.</p>
<h4>Positives</h4>
<ul>
<li>In depth – It covers its topics with such depth that it is very nearly a reference book on par with <a href="http://msdn.microsoft.com/">MSDN</a> articles on the subject. </li>
<li>Broad – There are very few areas of WPF that are left untouched, including 3-D, printing, and text processing. </li>
<li>Accessible – The writing is very clear and understandable. Many writers may know their subject but no matter how many books they write, they still can’t quite explain their subject clearly. Griffiths and Sells don’t suffer with that problem. </li>
<li>Indispensable – This book is truly useful. It’s one you will pick up again and again until its pages are worn. </li>
<li>It’s heavy – At 835 pages through the index, think of the exercise you’ll get! It <strong>is</strong> exercise and it counts. That’s my story and I’m sticking to it. </li>
</ul>
<h4>Negatives</h4>
<ul>
<li>It’s dated – I have to say it. Some subjects just aren’t covered because they didn’t exist when the book is written. I can’t find that there’s going to be a 3rd edition, which would be a shame. </li>
<li><a href="http://www.silverlight.net">Silverlight</a> chapter is useless – Sorry, Shawn. It’s just because it’s dated (see above). </li>
</ul>
<p>I honestly can’t say enough good things about this book. It has helped me immensely over the past few years and it still is. If you don’t have Programming WPF, you seriously should consider getting it.</p>
<p><iframe style="width: 120px; height: 240px" marginheight="0" src="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=systemwindows-20&amp;o=1&amp;p=8&amp;l=as1&amp;m=amazon&amp;f=ifr&amp;md=10FE9736YVPPT7A0FBG2&amp;asins=0596510373" frameborder="0" marginwidth="0" scrolling="no"></iframe></p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1074&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/qpy-5ALajqBlWM1NiYoOjK-qjG0/0/da"><img src="http://feedads.g.doubleclick.net/~a/qpy-5ALajqBlWM1NiYoOjK-qjG0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/qpy-5ALajqBlWM1NiYoOjK-qjG0/1/da"><img src="http://feedads.g.doubleclick.net/~a/qpy-5ALajqBlWM1NiYoOjK-qjG0/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=XiJ2QNJYVcQ:sN5dbrZh-60:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=XiJ2QNJYVcQ:sN5dbrZh-60:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=XiJ2QNJYVcQ:sN5dbrZh-60:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=XiJ2QNJYVcQ:sN5dbrZh-60:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=XiJ2QNJYVcQ:sN5dbrZh-60:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/XiJ2QNJYVcQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2010/05/wpf-on-your-shelf-programming-wpf-revisited-3-years-later/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2010/05/wpf-on-your-shelf-programming-wpf-revisited-3-years-later/</feedburner:origLink></item>
		<item>
		<title>WPF and the Event Routing Paradigm, with Bacon</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/DWoN-UVE8MY/</link>
		<comments>http://www.christopherestep.com/2010/05/wpf-and-the-event-routing-paradigm-with-bacon/#comments</comments>
		<pubDate>Mon, 24 May 2010 22:33:42 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2010/05/wpf-and-the-event-routing-paradigm-with-bacon/</guid>
		<description><![CDATA[Since the first event-driven language came down from the mountain and became part of the software development vernacular, there has been a certain notion of how an event works. Subscribe to event Event fires Deal with event Breakfast! All in all, it’s pretty simple.  And life was good. So along comes WPF and things start [...]]]></description>
			<content:encoded><![CDATA[<p>Since the first event-driven language came down from the mountain and became part of the software development vernacular, there has been a certain notion of how an event works.</p>
<table border="0" cellspacing="0" cellpadding="2" width="398">
<tbody>
<tr>
<td width="255" valign="top"><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="Subscribe to Event" src="http://www.christopherestep.com/wp-content/uploads/corporate_event_magazine.jpg" border="0" alt="Subscribe to Event" width="191" height="244" /></td>
<td width="141">Subscribe to event</td>
</tr>
<tr>
<td width="258" valign="top"><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="Fire that event!" src="http://www.christopherestep.com/wp-content/uploads/hunting.jpg" border="0" alt="Fire that event!" width="244" height="195" /></td>
<td width="139">Event fires</td>
</tr>
<tr>
<td width="260" valign="top"><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="Event Handling in Forms is easy, but messy" src="http://www.christopherestep.com/wp-content/uploads/Mylan_whole_pig_butcher.jpg" border="0" alt="Event Handling in Forms is easy, but messy" width="244" height="184" /></td>
<td width="137">Deal with event</td>
</tr>
<tr>
<td width="262" valign="top"><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="Direct Event Goodness!" src="http://www.christopherestep.com/wp-content/uploads/breakfast.jpg" border="0" alt="Direct Event Goodness!" width="244" height="184" /></td>
<td width="136">Breakfast!</td>
</tr>
</tbody>
</table>
<p>All in all, it’s pretty simple.  And life was good.</p>
<p>So along comes <a href="http://windowsclient.net">WPF</a> and things start to get a little more complicated. Events no longer have a simple one-to-one relationship. The event cycle may not be what you expect.</p>
<table border="0" cellspacing="0" cellpadding="2" width="398">
<tbody>
<tr>
<td width="255" valign="top"><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="Event Subscription" src="http://www.christopherestep.com/wp-content/uploads/corporate_event_magazine.jpg" border="0" alt="Event Subscription" width="191" height="244" /></td>
<td width="141">Subscribe to event</td>
</tr>
<tr>
<td width="258" valign="top"><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="Fire that event!" src="http://www.christopherestep.com/wp-content/uploads/hunting.jpg" border="0" alt="Fire that event!" width="244" height="195" /></td>
<td width="139">Event fires</td>
</tr>
<tr>
<td width="260" valign="top"><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="Events bubble and multiply" src="http://www.christopherestep.com/wp-content/uploads/hogfarm.jpg" border="0" alt="Events bubble and multiply" width="244" height="176" /></td>
<td width="137">Events everywhere!</td>
</tr>
<tr>
<td width="262" valign="top"><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="Event Handling doesn't have to be messy" src="http://www.christopherestep.com/wp-content/uploads/Mylan_whole_pig_butcher.jpg" border="0" alt="Event Handling doesn't have to be messy" width="244" height="184" /></td>
<td width="136">Deal with event</td>
</tr>
<tr>
<td width="262" valign="top"><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="Runaway Events" src="http://www.christopherestep.com/wp-content/uploads/tip_ny_0401_03.jpg" border="0" alt="Runaway Events" width="244" height="163" /></td>
<td width="136">Events still running away!</td>
</tr>
</tbody>
</table>
<p>As I said, it’s not quite what you expect. Previous to WPF, event handling was very direct and closed. An event went where it was told and that was that. With WPF, events have a mind of their own, or so it would seem.  But once you begin to understand what happens and why, WPF’s event-handling paradigm begins to make a lot more sense. And this paradigm is called Routed Events.</p>
<h4>Manual versus Automatic</h4>
<p>Windows Forms style event-handling is very manual. You subscribe to an event, deal with the event and it’s over, whether you like it or not. On one level, it means there are less pieces to worry about, less things that could go wrong. But the more you work with that style of event-handling, you realize how much your handcuffed by it.</p>
<p>To demonstrate the Windows Forms or CLR approach, I’ve made a Forms application to demonstrate how event processing occurred previously (and still does in non-WPF &amp; non-<a href="http://www.silverlight.net">Silverlight</a> applications)</p>
<p><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="RoutedEventWinForm-1" src="http://www.christopherestep.com/wp-content/uploads/RoutedEventWinForm1.jpg" border="0" alt="RoutedEventWinForm-1" width="303" height="305" /></p>
<p>And the following code-behind:</p>
<div id="codeSnippetWrapper" style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div id="codeSnippet" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">partial</span> <span style="color: #0000ff;">class</span> Form1 : Form</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">{</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">public</span> Form1()</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        InitializeComponent();</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        button1.GotFocus += <span style="color: #0000ff;">new</span> EventHandler(button1_GotFocus);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        button2.GotFocus += <span style="color: #0000ff;">new</span> EventHandler(button2_GotFocus);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        tabControl1.GotFocus += <span style="color: #0000ff;">new</span> EventHandler(tabControl1_GotFocus);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">void</span> tabControl1_GotFocus(<span style="color: #0000ff;">object</span> sender, EventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        textBox1.Text += String.Format(<span style="color: #006080;">"tabControl1 GotFocus{0}"</span>, Environment.NewLine);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">void</span> button2_GotFocus(<span style="color: #0000ff;">object</span> sender, EventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        textBox1.Text += String.Format(<span style="color: #006080;">"Button2 GotFocus{0}"</span>, Environment.NewLine);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">void</span> button1_GotFocus(<span style="color: #0000ff;">object</span> sender, EventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        textBox1.Text += String.Format(<span style="color: #006080;">"Button1 GotFocus{0}"</span>,Environment.NewLine);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">}</pre>
<p><!--CRLF--></p>
</div>
</div>
<p>Pretty simple.  When you it, you get:</p>
<p><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="RoutedEventWinForm-2" src="http://www.christopherestep.com/wp-content/uploads/RoutedEventWinForm2.jpg" border="0" alt="RoutedEventWinForm-2" width="303" height="304" /></p>
<p>All I did was tab through the controls and it printed exactly one line each time.</p>
<p>This is because normal events are “one and done” in the sense that once they are dealt with, they are considered to be handled and it’s all over.</p>
<p>Now let’s take a look what happens in WPF.  I made a simple form in WPF (if anything in WPF can be considered simple, but this one actually is) and wired the GotFocus event for each of the controls, but I also wired it up for the form itself.</p>
<p><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="RoutedEventWPF-1" src="http://www.christopherestep.com/wp-content/uploads/RoutedEventWPF1.jpg" border="0" alt="RoutedEventWPF-1" width="535" height="357" /></p>
<p>The XAML:</p>
<div id="codeSnippetWrapper" style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div id="codeSnippet" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Window</span> <span style="color: #ff0000;">x:Class</span><span style="color: #0000ff;">="WPFEventDemo.MainWindow"</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        <span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        <span style="color: #ff0000;">xmlns:x</span><span style="color: #0000ff;">="http://schemas.microsoft.com/winfx/2006/xaml"</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        <span style="color: #ff0000;">Title</span><span style="color: #0000ff;">="MainWindow"</span> <span style="color: #ff0000;">Height</span><span style="color: #0000ff;">="350"</span> <span style="color: #ff0000;">Width</span><span style="color: #0000ff;">="525"</span> <span style="color: #ff0000;">GotFocus</span><span style="color: #0000ff;">="Window_GotFocus"</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Canvas</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">TabControl</span> <span style="color: #ff0000;">Canvas</span>.<span style="color: #ff0000;">Left</span><span style="color: #0000ff;">="80"</span> <span style="color: #ff0000;">Canvas</span>.<span style="color: #ff0000;">Top</span><span style="color: #0000ff;">="46"</span> <span style="color: #ff0000;">Height</span><span style="color: #0000ff;">="100"</span> <span style="color: #ff0000;">Name</span><span style="color: #0000ff;">="tabControl1"</span> <span style="color: #ff0000;">Width</span><span style="color: #0000ff;">="200"</span> <span style="color: #ff0000;">GotFocus</span><span style="color: #0000ff;">="tabControl1_GotFocus"</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">            <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">TabItem</span> <span style="color: #ff0000;">Header</span><span style="color: #0000ff;">="tabItem1"</span> <span style="color: #ff0000;">Name</span><span style="color: #0000ff;">="tabItem1"</span> <span style="color: #ff0000;">GotFocus</span><span style="color: #0000ff;">="tabItem1_GotFocus"</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">                <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Grid</span> <span style="color: #ff0000;">GotFocus</span><span style="color: #0000ff;">="Grid_GotFocus"</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">                    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Button</span> <span style="color: #ff0000;">Content</span><span style="color: #0000ff;">="Button1"</span> <span style="color: #ff0000;">Height</span><span style="color: #0000ff;">="23"</span> <span style="color: #ff0000;">HorizontalAlignment</span><span style="color: #0000ff;">="Left"</span> <span style="color: #ff0000;">Margin</span><span style="color: #0000ff;">="20,11,0,0"</span> <span style="color: #ff0000;">Name</span><span style="color: #0000ff;">="button1"</span> <span style="color: #ff0000;">VerticalAlignment</span><span style="color: #0000ff;">="Top"</span> <span style="color: #ff0000;">Width</span><span style="color: #0000ff;">="75"</span> <span style="color: #ff0000;">GotFocus</span><span style="color: #0000ff;">="button1_GotFocus"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">                    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Button</span> <span style="color: #ff0000;">Content</span><span style="color: #0000ff;">="Button2"</span> <span style="color: #ff0000;">Height</span><span style="color: #0000ff;">="23"</span> <span style="color: #ff0000;">HorizontalAlignment</span><span style="color: #0000ff;">="Left"</span> <span style="color: #ff0000;">Margin</span><span style="color: #0000ff;">="20,39,0,0"</span> <span style="color: #ff0000;">Name</span><span style="color: #0000ff;">="button2"</span> <span style="color: #ff0000;">VerticalAlignment</span><span style="color: #0000ff;">="Top"</span> <span style="color: #ff0000;">Width</span><span style="color: #0000ff;">="75"</span> <span style="color: #ff0000;">GotFocus</span><span style="color: #0000ff;">="button2_GotFocus"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">                <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">Grid</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">            <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">TabItem</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">            <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">TabItem</span> <span style="color: #ff0000;">Header</span><span style="color: #0000ff;">="tabItem2"</span> <span style="color: #ff0000;">Name</span><span style="color: #0000ff;">="tabItem2"</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">                <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Grid</span> <span style="color: #0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">            <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">TabItem</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">TabControl</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">ScrollViewer</span> <span style="color: #ff0000;">Height</span><span style="color: #0000ff;">="116"</span> <span style="color: #ff0000;">Canvas</span>.<span style="color: #ff0000;">Left</span><span style="color: #0000ff;">="28"</span> <span style="color: #ff0000;">Canvas</span>.<span style="color: #ff0000;">Top</span><span style="color: #0000ff;">="172"</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">            <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">TextBlock</span>  <span style="color: #ff0000;">Name</span><span style="color: #0000ff;">="tb"</span> <span style="color: #ff0000;">Text</span><span style="color: #0000ff;">=""</span> <span style="color: #ff0000;">Width</span><span style="color: #0000ff;">="446"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">ScrollViewer</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">Canvas</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">Window</span><span style="color: #0000ff;">&gt;</span></pre>
<p><!--CRLF--></p>
</div>
</div>
<p>And the code-behind:</p>
<div id="codeSnippetWrapper" style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div id="codeSnippet" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">partial</span> <span style="color: #0000ff;">class</span> MainWindow : Window</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">{</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">public</span> MainWindow()</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        InitializeComponent();</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> button1_GotFocus(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        tb.Text += String.Format(<span style="color: #006080;">"Button1 GotFocus \n"</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> button2_GotFocus(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        tb.Text += String.Format(<span style="color: #006080;">"Button2 GotFocus \n"</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> Grid_GotFocus(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        tb.Text += String.Format(<span style="color: #006080;">"Tab 1 Grid GotFocus \n"</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> tabItem1_GotFocus(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        tb.Text += String.Format(<span style="color: #006080;">"tabItem1 GotFocus \n"</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> tabControl1_GotFocus(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        tb.Text += String.Format(<span style="color: #006080;">"tabControl1 GotFocus \n"</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> Window_GotFocus(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        tb.Text += String.Format(<span style="color: #006080;">"----------------------------\n"</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">}</pre>
<p><!--CRLF--></p>
</div>
</div>
<p>And when you run it you get:</p>
<p><img style="margin: 5px 5px 5px 0px; display: inline; border-width: 0px;" title="RoutedEventWPF-2" src="http://www.christopherestep.com/wp-content/uploads/RoutedEventWPF2.jpg" border="0" alt="RoutedEventWPF-2" width="535" height="354" /></p>
<p>with the following in the TextBlock:</p>
<p>tabItem1 GotFocus</p>
<p>tabControl1 GotFocus</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Button1 GotFocus</p>
<p>Tab 1 Grid GotFocus</p>
<p>tabItem1 GotFocus</p>
<p>tabControl1 GotFocus</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Button2 GotFocus</p>
<p>Tab 1 Grid GotFocus</p>
<p>tabItem1 GotFocus</p>
<p>tabControl1 GotFocus</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Each section is the result of a single press of the tab key, including the dashed line. What you’re seeing is the result of event bubbling and this happens every time an event is fired in WPF and Silverlight.  Look at the second group. When I tabbed to the button, it fired GotFocus for the deepest, nested object and then bubbled up doing likewise to each object in the tree until there were no more left. In fact, the GotFocus event for MainWindow is what added the dashed line at the end.</p>
<p>But what if you don’t want that behavior?  That’s simple enough. You may have noticed that I haven’t been using the term “handle” for dealing with events. This was intentional, because “handled” has a specific meaning in RoutedEvent processing and now you’re going to learn what.</p>
<p>If you don’t want events to bubble up past a certain point, all you need to do is set Handled=true for RoutedEventArgs in the handler. At that point the bubbling stops and WPF truly considers the event completely handled. What is key is that I said “past a certain point”. You can stop the bubbling anywhere in the hierarchy, not just at the control that caused the event.</p>
<p>In the following code, I’ve set Handled to true at Button1 and tabItem1.  Watch what happens.</p>
<p><img style="margin: 5px 5px 5px 0px; display: inline; border: 0px;" title="RoutedEventWPF-3" src="http://www.christopherestep.com/wp-content/uploads/RoutedEventWPF3.jpg" border="0" alt="RoutedEventWPF-3" width="530" height="354" /></p>
<p>Again, I tabbed 3 times. The first tab gave focus to tabItem1 and since I set Handled to true in tabItem1, that’s all it printed. The second tab went to Button1 and since Handled is true in that method, it also just prints one line. But I didn’t set anything in Button2 so when I tabbed to that control, it ran the handlers for Button1, the unnamed grid that is it&#8217;s parent and tabItem1, again stopping.</p>
<p>It’s important to note that if I had clicked tabItem2, it would have printed “tabControl1 GotFocus” and a dashed line because I never removed those handlers.</p>
<h4>Conditional handling</h4>
<p>I put the following code in the the tabControl1 GotFocus handler method:</p>
<div id="codeSnippetWrapper" style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div id="codeSnippet" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> tabControl1_GotFocus(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">{</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    Control osControl = e.Source <span style="color: #0000ff;">as</span> Control;</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">if</span> (osControl.Name == <span style="color: #006080;">"button1"</span> || osControl.Name == <span style="color: #006080;">"tabItem2"</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        e.Handled = <span style="color: #0000ff;">true</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">}</pre>
<p><!--CRLF--></p>
</div>
</div>
<p>And what you’ve got is a very simple way of conditionally deciding if you want the event to keep bubbling all the way up the tree.</p>
<p>I hope I’ve given you enough information so that in your own events processing you can turn this…</p>
<p><img style="margin: 5px 5px 5px 0px; display: inline; border: 0px;" title="Runaway Events!" src="http://www.christopherestep.com/wp-content/uploads/tip_ny_0401_031.jpg" border="0" alt="Runaway Events!" width="615" height="408" /></p>
<p>into this…</p>
<p><img style="margin: 5px 5px 5px 0px; display: inline; border: 0px;" title="Event Handling Tastes Like Bacon!" src="http://www.christopherestep.com/wp-content/uploads/baconbaconbacon.jpg" border="0" alt="Event Handling Tastes Like Bacon!" width="604" height="434" /></p>
<h3>(ALTERNATE VERSION for vegetarians)</h3>
<p>I hope I’ve given you enough information so that in your own events processing you can turn this…</p>
<p><img style="margin: 5px 5px 5px 0px; display: inline; border: 0px;" title="Evil Carrot" src="http://www.christopherestep.com/wp-content/uploads/LostInSpaceCarrot.jpg" border="0" alt="Evil Carrot" width="454" height="310" /></p>
<p>into this…</p>
<p><img style="margin: 5px 5px 5px 0px; display: inline; border: 0px;" title="Event Salad!" src="http://www.christopherestep.com/wp-content/uploads/pickled_carrots_5.jpg" border="0" alt="Event Salad!" width="544" height="409" /></p>
<p>[Side note: Yes, I know I only talked about Bubbling and WPF also supports Tunneling.  I’ll cover Tunneling in a future post!]</p>
<p>[Side note 2: Yes, I also know that Routed Events are not a new subject in the WPF and Silverlight world, but I was asked about them and it's never a bad time to go over the fundamentals.]</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.christopherestep.com%2f2010%2f05%2fwpf-and-the-event-routing-paradigm-with-bacon%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.christopherestep.com%2f2010%2f05%2fwpf-and-the-event-routing-paradigm-with-bacon%2f&amp;bgcolor=0066CC" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1068&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/LcJ9Rotz5ZbeeUm2dbRfhYSfDOA/0/da"><img src="http://feedads.g.doubleclick.net/~a/LcJ9Rotz5ZbeeUm2dbRfhYSfDOA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/LcJ9Rotz5ZbeeUm2dbRfhYSfDOA/1/da"><img src="http://feedads.g.doubleclick.net/~a/LcJ9Rotz5ZbeeUm2dbRfhYSfDOA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=DWoN-UVE8MY:f2wOJuEhLkw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=DWoN-UVE8MY:f2wOJuEhLkw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=DWoN-UVE8MY:f2wOJuEhLkw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=DWoN-UVE8MY:f2wOJuEhLkw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=DWoN-UVE8MY:f2wOJuEhLkw:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/DWoN-UVE8MY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2010/05/wpf-and-the-event-routing-paradigm-with-bacon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2010/05/wpf-and-the-event-routing-paradigm-with-bacon/</feedburner:origLink></item>
		<item>
		<title>Are 2 syllables slowing you down?</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/L2PJChrgyjU/</link>
		<comments>http://www.christopherestep.com/2010/05/are-2-syllables-slowing-you-down/#comments</comments>
		<pubDate>Sat, 15 May 2010 11:53:35 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2010/05/are-2-syllables-slowing-you-down/</guid>
		<description><![CDATA[Rant alert. In the English language, all of the letters of the alphabet have one syllable. Well, except for one. And that letter is the dreaded W. In the world of computers, we have acronyms for almost everything, and what we doesn’t have a TLA has an abbreviation instead. Unfortunately, since Microsoft chose to name [...]]]></description>
			<content:encoded><![CDATA[<p>Rant alert.</p>
<p>In the English language, all of the letters of the alphabet have one syllable. Well, except for one. And that letter is the dreaded W.</p>
<p>In the world of computers, we have acronyms for almost everything, and what we doesn’t have a <a title="Three Letter Acronym" href="http://en.wikipedia.org/wiki/Three-letter_acronym" target="_blank">TLA</a> has an abbreviation instead. Unfortunately, since <a href="http://www.microsoft.com">Microsoft</a> chose to name their flagship product <a href="http://www.microsoft.com/windows/default.aspx?icid=winvan" target="_blank">Windows</a>, much of those TLA’s start with the dreaded W.</p>
<p>Whether software developers are efficient or just lazy is a topic for debate. As I will note, I tend toward believing in the “lazy” angle.</p>
<p>What is this letter?</p>
<p>W</p>
<p>Say it out loud.</p>
<p>Do you say “double – you”?&#160; Of course you do. You don’t say “dub”. Nobody says “dub”.</p>
<p>So tell me, why in the world would you ever pronounce “WCF” as “dub see eff”?!</p>
<p>Are you that lazy?&#160; Really?&#160; Are the syllables “bull you” really slowing you down so much that you have to just drop them? Is your tongue so tied and twisted that you can’t say them fast enough?&#160; I picture this exchange.</p>
<p>Bob: I learned a tongue twister today.Seven silver swans swam silently seaward.</p>
<p>Jane: That’s nothing. Try “WCF and WF”</p>
<p>Bob: Stop!!! It’s too hard!!!</p>
<p>Ok, I’m done with my rant.&#160; But let’s be real. saying “dub-eff” or “dub see eff” just makes you look stupid. </p>
<p>Friends don’t let friends butcher the language.</p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1052&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/gMXiFibQxFfFLgMPkGKhOLZaw_E/0/da"><img src="http://feedads.g.doubleclick.net/~a/gMXiFibQxFfFLgMPkGKhOLZaw_E/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/gMXiFibQxFfFLgMPkGKhOLZaw_E/1/da"><img src="http://feedads.g.doubleclick.net/~a/gMXiFibQxFfFLgMPkGKhOLZaw_E/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=L2PJChrgyjU:pFwvSbnS4Hw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=L2PJChrgyjU:pFwvSbnS4Hw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=L2PJChrgyjU:pFwvSbnS4Hw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=L2PJChrgyjU:pFwvSbnS4Hw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=L2PJChrgyjU:pFwvSbnS4Hw:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/L2PJChrgyjU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2010/05/are-2-syllables-slowing-you-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2010/05/are-2-syllables-slowing-you-down/</feedburner:origLink></item>
		<item>
		<title>How to stop Expression Blend 4 RC from crashing on startup</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/KqmdMnNxxjU/</link>
		<comments>http://www.christopherestep.com/2010/04/how-to-stop-expression-blend-4-rc-from-crashing-on-startup/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 01:36:09 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Crash]]></category>
		<category><![CDATA[Deja Vu]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[OpenOffice]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2010/04/how-to-stop-expression-blend-4-rc-from-crashing-on-startup/</guid>
		<description><![CDATA[So you’ve downloaded Expression Blend 4 RC but when you start it up, Blend crashes hard.&#160; It’s never done that before, right? What do you do?&#160; Well, you can do what I and a few others did and spend hours uninstalling and reinstalling various software in the (vain) hope that it will solve your problem.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>So you’ve <a title="Download Expression Blend 4 RC" href="http://go.microsoft.com/fwlink/?LinkId=169446">downloaded Expression Blend 4 RC</a> but when you start it up, Blend crashes <strong>hard</strong>.&#160; It’s never done that before, right?</p>
<p>What do you do?&#160; Well, you can do what I and a few others did and spend hours uninstalling and reinstalling various software in the (vain) hope that it will solve your problem.&#160; It won’t.</p>
<p>Or you can learn from my experience and solve the problem in a matter of minutes.</p>
<p>Let me ask you first, do you have <a href="http://en.wikipedia.org/wiki/OpenOffice.org">OpenOffice</a> on your computer or have you ever had it? I can say with a degree of certainty that therein lies your problem.</p>
<p>Apparently, there’s a typeface called “Deja Vu” from Bitstream that Blend 4 RC doesn’t like. And by “doesn’t like” I mean, “makes your program go boom”.</p>
<p>There’s an easy fix.&#160; Delete the font files. That’s all there is to it.&#160; Since Blend is a technical tool, I’m not going to tell you how to delete the files.&#160; If you don’t know how, it’s worth your time to figure it out.</p>
<p>If you want to know how I figured this out and get a little more detail on the error messages, go over to <a title="Silverlight.Net forums" href="http://forums.silverlight.net/forums/p/176008/396388.aspx">this thread where my answer was originally posted</a>.</p>
<p>And remember, friends don’t let friends use OpenOffice. <img src='http://www.christopherestep.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Update</h3>
<p><a href="http://www.microsoft.com">Microsoft</a> has <a href="http://blogs.msdn.com/expression/archive/2010/04/26/minor-update-to-the-expression-blend-4-release-candidate.aspx">fixed the problem</a> and released an <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=88484825-1b3c-4e8c-8b14-b05d025e1541">update to Expression Blend 4</a>. I haven’t tested it myself (since I removed the offending font) but hopefully this does the trick!</p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1047&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/_YxcVAOJQmRUbeZljqNZPxpEIkk/0/da"><img src="http://feedads.g.doubleclick.net/~a/_YxcVAOJQmRUbeZljqNZPxpEIkk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/_YxcVAOJQmRUbeZljqNZPxpEIkk/1/da"><img src="http://feedads.g.doubleclick.net/~a/_YxcVAOJQmRUbeZljqNZPxpEIkk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=KqmdMnNxxjU:jWZiIm4pnvk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=KqmdMnNxxjU:jWZiIm4pnvk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=KqmdMnNxxjU:jWZiIm4pnvk:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=KqmdMnNxxjU:jWZiIm4pnvk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=KqmdMnNxxjU:jWZiIm4pnvk:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/KqmdMnNxxjU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2010/04/how-to-stop-expression-blend-4-rc-from-crashing-on-startup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2010/04/how-to-stop-expression-blend-4-rc-from-crashing-on-startup/</feedburner:origLink></item>
		<item>
		<title>Absent from my Grok List</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/wjVsG2Tp0B0/</link>
		<comments>http://www.christopherestep.com/2010/02/absent-from-my-grok-list/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 20:14:08 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Basics]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2010/02/absent-from-my-grok-list/</guid>
		<description><![CDATA[It’s been suggested that my WPF Must-Grok List is “basically the whole WPF” so in my own defense, I thought I’d list a few items to illustrate how WPF is far deeper than my list: Attached Properties Visual &#38; Logical Trees MVVM Prism Click-once deployment Browser apps Animation Graphics (2D) 3D Graphics Flow Documents &#38; [...]]]></description>
			<content:encoded><![CDATA[<p>It’s <a href="http://twitter.com/ramil/status/8972424010">been suggested</a> that my <a href="http://www.christopherestep.com/2010/02/the-wpf-must-grok-list/">WPF Must-Grok List</a> is “basically the whole WPF” so in my own defense, I thought I’d list a few items to illustrate how WPF is far deeper than my list:</p>
<ol>
<li>Attached Properties</li>
<li>Visual &amp; Logical Trees</li>
<li>MVVM</li>
<li>Prism</li>
<li>Click-once deployment</li>
<li>Browser apps</li>
<li>Animation</li>
<li>Graphics (2D)</li>
<li>3D Graphics</li>
<li>Flow Documents &amp; Text</li>
<li>Ink</li>
<li>Printing &amp; XPS</li>
<li>Media</li>
<li>Adorners</li>
<li>Custom controls</li>
<li>Interop</li>
</ol>
<p>And even this is not a complete list.</p>
<p>Remember, WPF is a new paradigm in software UI development. It does have a significant learning curve and it is a huge mistake to oversimplify it.</p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1038&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/X_BbA8W4Wcx_BfyaQhnT19Zn9qg/0/da"><img src="http://feedads.g.doubleclick.net/~a/X_BbA8W4Wcx_BfyaQhnT19Zn9qg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/X_BbA8W4Wcx_BfyaQhnT19Zn9qg/1/da"><img src="http://feedads.g.doubleclick.net/~a/X_BbA8W4Wcx_BfyaQhnT19Zn9qg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=wjVsG2Tp0B0:5AopKbyjfEM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=wjVsG2Tp0B0:5AopKbyjfEM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=wjVsG2Tp0B0:5AopKbyjfEM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=wjVsG2Tp0B0:5AopKbyjfEM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=wjVsG2Tp0B0:5AopKbyjfEM:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/wjVsG2Tp0B0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2010/02/absent-from-my-grok-list/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2010/02/absent-from-my-grok-list/</feedburner:origLink></item>
		<item>
		<title>The WPF Must-Grok List</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/RHLp613a4dI/</link>
		<comments>http://www.christopherestep.com/2010/02/the-wpf-must-grok-list/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 18:30:37 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[Learning]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2010/02/the-wpf-must-grok-list/</guid>
		<description><![CDATA[Robert A. Heinlein defined the word grok as: Grok means to understand so thoroughly that the observer becomes a part of the observed—to merge, blend, intermarry, lose identity in group experience. or in other words, to fully completely understand and internalize it.  It’s the difference between knowing something because you have read it and truly [...]]]></description>
			<content:encoded><![CDATA[<p>Robert A. Heinlein <a href="http://www.amazon.com/gp/product/0441788386?ie=UTF8&amp;tag=systemwindows-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0441788386">defined the word grok</a><img class=" bkycmybxayfpsckepank bkycmybxayfpsckepank" style="margin: 0px; border: medium none;" src="http://www.assoc-amazon.com/e/ir?t=systemwindows-20&amp;l=as2&amp;o=1&amp;a=0441788386" border="0" alt="" width="1" height="1" /> as:</p>
<blockquote><p>Grok means to understand so thoroughly that the observer becomes a part of the observed—to merge, blend, intermarry, lose identity in group experience.</p></blockquote>
<p>or in other words, to fully completely understand and internalize it.  It’s the difference between knowing something because you have read it and truly knowing how it works and why.  I would say that it’s the difference between intellect and application.</p>
<p><a href="http://www.sxc.hu/photo/79721"><img style="margin: 5px 0px 5px 10px; display: inline; border: 0px;" title="Man thinking in libraryjpg" src="http://www.christopherestep.com/wp-content/uploads/Manthinkinginlibraryjpg1.jpg" border="0" alt="Man thinking in libraryjpg" width="244" height="164" align="right" /></a></p>
<p>As I’ve said before, WPF is in many ways a <a href="http://www.christopherestep.com/2009/10/wpf-what-it-is-and-what-it-is-not/" target="_blank">paradigm shift</a> in software development, especially if you’re coming from the Windows Forms world.  As a result, there are a number of new (and/or different) concepts that you really have to grasp, or grok before you could ever consider yourself proficient.  I’ve been working with WPF for about 2 years now and there are still things that make me stop and think.  Having said that, I think the effort is certainly work making and the result of your hard work is software that is also worth making.</p>
<p>So for budding WPF developers, I give you a list (as opposed to a tutorial) of what I think are some of the most important concepts and methodologies that you really should master in order to get the the most out of WPF.</p>
<ol>
<li><a href="http://msdn.microsoft.com/en-us/library/ms752914.aspx" target="_blank">Dependency Properties</a> – It is impossible to be even remotely effective in WPF if you don’t understand them.  In many ways, dependency properties are the basic nerve system of WPF.  Very little functionality exists in WPF that doesn’t rely on them.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms752059.aspx" target="_blank">XAML</a> – If you don’t like it or are resistant, just suck it up and deal with it.  Seriously. XAML is not only used in WPF, but in <a href="http://www.silverlight.net" target="_blank">Silverlight</a> and <a title="Windows Workflow Foundation" href="http://msdn.microsoft.com/en-us/netframework/aa663328.aspx" target="_blank">WF</a> as well.  Whether it’s XAML, HTML, or plain-old XML, the XML-based development methodologies are here to stay.</li>
<li><a href="http://msdn.microsoft.com/en-us/magazine/cc163299.aspx">Binding</a>, binding, and more binding – I can’t even begin to stress how important it is to understand WPF data binding. You simply can’t develop with WPF without it and it takes more than a basic understanding to use it effectively.  You genuinely need to understand the hows and whys or else you’ll spend more time debugging your bindings than just about anything else.  Even if you actually do grok WPF data binding, you’ll still probably spend a significant slice of your debugging time fixing and diagnosing your bindings.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms742806.aspx">Routed Events</a> – WPF handles events differently than other technologies, introducing the concepts of “bubbling” and “tunneling” to event handling.  While you can still handle events the old way, you shouldn’t. Trust me on this one. Routed events will ultimately make your life easier than you can imagine, at least as far as event handling is concerned.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms751593.aspx">Commands</a> – Again, you can do things the “old way” but Commanding solves a number of problems, particularly aiding in the best practice of separation of concerns and encapsulation. The command pattern is somewhat different in WPF than what you may be used to, so it’s best not to assume that you know how it works already (with WPF) which is why it’s on this list.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms745058.aspx">Layout</a>, Measuring, and Arranging – WPF lays out controls and children using very specific rules and principles.  While a comprehensive understanding isn’t required unless you’re writing your own controls, you still need to get a handle on how measuring and arranging works and what is done during each phase. This will really help when WPF puts something where you aren’t expecting and you’ll know where to look for a solution.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms741870.aspx">WPF Threading</a> – Yes, I’m serious. If you’re like many programmers, you’ve avoided threading topics as being either too esoteric or more “bare metal” than you need to deal with. I get that. Business application developers have historically had no concern for threading because we typically deal with “fast enough” performance. WPF changes that, seriously.  It doesn’t change the practice of “fast enough” for business applications, but it rigidly requires all updates to UI objects be made from the UI thread. Again, I realize this isn’t a problem for the vast majority of programs. But I promise that at some point when you don’t have time to study a new topic, you’ll be using some asynchronous API and will try to make a change to a UI element from another thread and WPF simply will not let you. It will happen, I assure you. Asynchronous API’s are becoming the norm and unless your applications never interact with the outside world, you’ll be using one at some point.  It’s better to know what the Dispatcher is, how it works so you don’t have to take a crash course in WPF threading when you can least afford to spend the time to do so.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms745683.aspx">Styles &amp; Templates</a> – Fortunately, WPF’s implementation of styles is pretty straight forward. But, like so much of WPF, it’s different than what you’re going to be used to and you absolutely must know how they work. Unlike most of CSS, WPF styles allow you to dramatically affect behavior as well as appearance and that’s why they’re so crucial. Templates (especially Data Templates) also affect behavior and appearance but in a different (though complementary) way. Both are integral to almost every WPF application.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.trigger.aspx">Triggers</a> – While Microsoft includes them in with styles &amp; templates, I think triggers deserve mention on their own.  Yes, it’s through triggers that styles and templates can manipulate your controls, they’re important enough to require study on their own. In my mind, triggers are like declarative event handlers that can be put pretty much anywhere without having to worry about the actual event handling plumbing itself. Triggers will also be the means by which you do any animation and a variety of other tasks.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms750613.aspx">Resources</a> – You must understand how resources work. I can’t say it any more simply than that.  Resources are such an integral part of WPF, you will use them in every single application you write and almost every single XAML file and much code as well. More than anything in WPF, resources tie your application together.</li>
</ol>
<p>Obviously, this isn’t an all-encompassing list. There are certainly more topics that you need to know, not the least of which being the myriad of WPF controls, deployment, printing, and so forth.  But I can honestly say that without knowing and truly understanding the 10 concepts I’ve outlined above, you’re doing yourself, your customers, and (if applicable) your employer a grave disservice by not being the WPF expert you could be.</p>
<p>And don’t misunderstand me, either. Knowing these concepts only provide the foundation for so much more you’ll have to learn through experience. My grok-list is the beginning, not the end. But if you do grok these concepts and technologies, I promise you that you’re well on your way to being the expert you want to be.</p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1035&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/yKU2xB1veLDKWbM64zrnCYzTkNY/0/da"><img src="http://feedads.g.doubleclick.net/~a/yKU2xB1veLDKWbM64zrnCYzTkNY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/yKU2xB1veLDKWbM64zrnCYzTkNY/1/da"><img src="http://feedads.g.doubleclick.net/~a/yKU2xB1veLDKWbM64zrnCYzTkNY/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=RHLp613a4dI:wTJcDtVNeiw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=RHLp613a4dI:wTJcDtVNeiw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=RHLp613a4dI:wTJcDtVNeiw:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=RHLp613a4dI:wTJcDtVNeiw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=RHLp613a4dI:wTJcDtVNeiw:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/RHLp613a4dI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2010/02/the-wpf-must-grok-list/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2010/02/the-wpf-must-grok-list/</feedburner:origLink></item>
		<item>
		<title>Yes, Virginia, TextBlock.Text Will Support MultiBinding</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/PnndkzfP7rY/</link>
		<comments>http://www.christopherestep.com/2009/12/yes-virginia-textblock-text-will-support-multibinding/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 19:03:46 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Pain Points]]></category>
		<category><![CDATA[Binding]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Text]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2009/12/yes-virginia-textblock-text-will-support-multibinding/</guid>
		<description><![CDATA[One of the features introduced to WPF in version 3.5 SP1 is the StringFormat property. If you’re unaware, StringFormat allows you to bring the String.Format capability to WPF binding and is particularly useful in MultiBinding scenarios.  If you search through the internet, you’ll see many examples of people using TextBox.Text and TextBlock.Text with MultiBinding, such [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt">One of the features introduced to WPF in version 3.5 SP1 is the <a href="http://blogs.msdn.com/llobo/archive/2008/05/19/wpf-3-5-sp1-feature-stringformat.aspx">StringFormat property</a>.</p>
<p>If you’re unaware, StringFormat allows you to bring the String.Format capability to WPF binding and is particularly useful in MultiBinding scenarios.  If you search through the internet, you’ll see many examples of people using TextBox.Text and TextBlock.Text with MultiBinding, such as:</p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt"><span style="font-size: small;"><span style="font-family: consolas; color: blue"> </span></span></p>
<div id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:f9ab40c9-6e7f-4d0d-9ed2-a14db199fbfb" class="wlWriterEditableSmartContent" style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px;"><span style="color:#a31515"> </span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span><span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&#8221;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Path</span><span style="color:#0000ff">=Double,</span><span style="color:#ff0000"> StringFormat</span><span style="color:#0000ff">=F3}&#8221;/&gt;</span><br />
<span style="color:#a31515"> </span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span><span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&#8221;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Path</span><span style="color:#0000ff">=Double,</span><span style="color:#ff0000"> StringFormat</span><span style="color:#0000ff">=Amount: {</span>0<span style="color:#0000ff">:</span><span style="color:#a31515">C}}</span><span style="color:#0000ff">&#8220;/&gt;</span><br />
<span style="color:#a31515"> </span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span><span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&#8221;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Path</span><span style="color:#0000ff">=Double,</span><span style="color:#ff0000"> StringFormat</span><span style="color:#0000ff">=Amount:</span> \\cf2 {0<span style="color:#0000ff">:</span><span style="color:#a31515">C\</span>\cf2 }}&#8221;/&gt;<br />
<span style="color:#a31515"> </span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox</span><span style="color:#0000ff">&gt;</span><br />
<span style="color:#0000ff">&lt;</span><span style="color:#a31515">TextBox.Text</span><span style="color:#0000ff">&gt;</span><br />
<span style="color:#0000ff">&lt;</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Path</span><span style="color:#0000ff">=&#8221;Double&#8221;</span><span style="color:#ff0000"> StringFormat</span><span style="color:#0000ff">=&#8221;{}{0:C}&#8221;/&gt;</span><br />
<span style="color:#0000ff">&lt;/</span><span style="color:#a31515">TextBox.Text</span><span style="color:#0000ff">&gt;</span><br />
<span style="color:#0000ff">&lt;/</span><span style="color:#a31515">TextBox</span><span style="color:#0000ff">&gt;</span></div>
</div>
</div>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt">
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt">It’s all good, right?  Well, guess what happens when you try to use similar code in Visual Studio:</p>
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt">
<p><a href="http://www.christopherestep.com/wp-content/uploads/TextPropertyError.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="TextPropertyError" src="http://www.christopherestep.com/wp-content/uploads/TextPropertyError_thumb.png" border="0" alt="TextPropertyError" width="704" height="335" /></a></p>
<p>Oh No!  Right?</p>
<p>Wrong!</p>
<p>It turns out that in spite of the error, the code works just fine.  Needless to say, I’ll be reporting this bug. But until it’s fixed, it’s wise to remember that you can’t always trust inline syntax checking and to do your homework before deciding to abandon a proven technique.</p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1030&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/Z9qC_7BbfUvrQfhY82Hd9-q1pmc/0/da"><img src="http://feedads.g.doubleclick.net/~a/Z9qC_7BbfUvrQfhY82Hd9-q1pmc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Z9qC_7BbfUvrQfhY82Hd9-q1pmc/1/da"><img src="http://feedads.g.doubleclick.net/~a/Z9qC_7BbfUvrQfhY82Hd9-q1pmc/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=PnndkzfP7rY:iLWRhLkLvRo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=PnndkzfP7rY:iLWRhLkLvRo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=PnndkzfP7rY:iLWRhLkLvRo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=PnndkzfP7rY:iLWRhLkLvRo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=PnndkzfP7rY:iLWRhLkLvRo:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/PnndkzfP7rY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2009/12/yes-virginia-textblock-text-will-support-multibinding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2009/12/yes-virginia-textblock-text-will-support-multibinding/</feedburner:origLink></item>
		<item>
		<title>Silverlight Experiment post-mortem</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/ZB-D7hWzVgM/</link>
		<comments>http://www.christopherestep.com/2009/11/silverlight-experiment-post-mortem/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 22:48:36 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2009/11/silverlight-experiment-post-mortem/</guid>
		<description><![CDATA[Well, I finished my experiment with Silverlight, specifically Silverlight 3.&#160; If you recall, the aim was prove to myself that I could translate my WPF skills into Silverlight and how quickly. Mission accomplished!&#160; I made a number of Silverlight controls and small apps and I was very pleased with how easy that translation was.&#160; Initially, [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I finished my experiment with Silverlight, specifically Silverlight 3.&#160; If you recall, the aim was prove to myself that I could translate my WPF skills into Silverlight and how quickly.</p>
<p>Mission accomplished!&#160; </p>
<p>I made a number of Silverlight controls and small apps and I was very pleased with how easy that translation was.&#160; Initially, i was going to make an Amazon widget, which I may still do at some point, but I abandoned it about 3 hours into doing so because by that time, I’d proven to myself that I could easily take what I know in WPF and downgrade them into Silverlight and what remained for that widget was more fine tuning than development and didn’t serve to be a test of my skills.</p>
<p>So I chose to venture into other areas of Silverlight and with very little exception, I found that WPF skills do scale down to SL quite well.</p>
<p>I know some Silverlight people might object to my terminology such as “downgrade” and “scale down” but let’s be realistic.&#160; That’s what it is.&#160; There is so much you can do in WPF and do it more easily than you can in Silverlight that detailing the differences would be far beyond the scope of this post or my blog (at least for now).&#160; Remember that from the outset, Silverlight was intended to be Windows Presentation Framework, Everywhere.&#160; And to a large degree, that’s what it is.</p>
<p>The bottom line for me is that I can do both with equal aplomb.&#160; There are nuances to each, but even those are becoming less obvious.&#160; For instance, Silverlight uses “states” where WPF does not.&#160; Or does it?</p>
<p>WPF version 4 is now in Beta 2.&#160; One of the <a href="http://msdn.microsoft.com/en-us/library/bb613588%28VS.100%29.aspx">many things that have been added</a> in WPF version 4 is the official inclusion of the <a href="http://msdn.microsoft.com/en-us/library/bb613588%28VS.100%29.aspx">Visual State Manager</a>.&#160; I say “official” because it’s been available to developers of WPF for quite some time, but it’s an out-of-band download in the <a href="http://wpf.codeplex.com/">WPF Toolkit</a>.</p>
<p>Convergence is the order of the day in what I like to call the XAML-space.&#160; Many WPF developers felt slighted at PDC 09 because of the prominence of Silverlight 4 and the complete absence of WPF in both keynotes.&#160; I even saw many people on Twitter saying that “<a href="http://search.twitter.com/search?q=wpf+dead">WPF is dead</a>” though I don’t agree.&#160; The technologies are coming closer together and I find it ironic that what some people are saying is “dead” is actually closer to the WPF/Everywhere vision that was originally intended.</p>
<p>Having said that, I think that Silverlight is still a niche product and should be treated as such.&#160; Unless you have cross-platform concerns (MS still owns over 90% of the desktops) or are going to need the expected future Silverlight on mobile, WPF is still the best choice for the desktop.</p>
<p>Remember, to the man with a hammer, everything looks like a nail.&#160; Just because you know web application development doesn’t mean that every application should be a web application.</p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1027&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/OOQ8wjuNolyb4MuBn7RS5FnSWwg/0/da"><img src="http://feedads.g.doubleclick.net/~a/OOQ8wjuNolyb4MuBn7RS5FnSWwg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/OOQ8wjuNolyb4MuBn7RS5FnSWwg/1/da"><img src="http://feedads.g.doubleclick.net/~a/OOQ8wjuNolyb4MuBn7RS5FnSWwg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=ZB-D7hWzVgM:K9lLUrsbxi8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=ZB-D7hWzVgM:K9lLUrsbxi8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=ZB-D7hWzVgM:K9lLUrsbxi8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=ZB-D7hWzVgM:K9lLUrsbxi8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=ZB-D7hWzVgM:K9lLUrsbxi8:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/ZB-D7hWzVgM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2009/11/silverlight-experiment-post-mortem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2009/11/silverlight-experiment-post-mortem/</feedburner:origLink></item>
		<item>
		<title>10 Reasons to be Glad You’re Watching the PDC09 Keynote Online</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/E9XIvBoTHL4/</link>
		<comments>http://www.christopherestep.com/2009/11/10-reasons-to-be-glad-youre-watching-the-pdc09-keynote-online/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 16:13:40 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[pdc09]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2009/11/10-reasons-to-be-glad-youre-watching-the-pdc09-keynote-online/</guid>
		<description><![CDATA[You get walk into the kitchen and fix your own food when you realize that PDC doesn’t have breakfast. ( Right, @timheuer?&#160; ) No “Genius BO” to have to suffer through.&#160; You know who I mean.&#160; You’re sitting behind a guy so brilliant that he could write a new programming language in its entirety on [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>You get walk into the kitchen and fix your own food when you realize that <a href="http://twitter.com/timheuer/status/5798420015">PDC doesn’t have breakfast</a>. ( Right, <a href="http://twitter.com/timheuer">@timheuer</a>?&#160; <img src='http://www.christopherestep.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</li>
<li>No “Genius BO” to have to suffer through.&#160; You know who I mean.&#160; You’re sitting behind a guy so brilliant that he could write a new programming language in its entirety on his laptop in during the keynote but apparently can’t comprehend the nuances of personal hygiene.</li>
<li>You can threaten Ray Ozzie out loud if he says the word “Cloud” just one more time without having to miss the rest of PDC due to your sudden but imminent incarceration.</li>
<li>You get to experience the joy of your two year old coming into your home office during the keynote and asking you, “doin, daddy? Watching tv on puter?”</li>
<li>You can get the poppy seed from the bagel you got from your kitchen (see #1) unstuck without someone next to you saying, “STOP SUCKING YOUR TEETH!”</li>
<li>Real Internet access.&#160; ‘nuff said.</li>
<li>Your body and brain thinks it’s 11:30 because guess what?&#160; It really IS 11:30!</li>
<li>You can watch the entire speech without having to decide whether to leave early so you can a good spot in line at Starbucks.*</li>
<li>The “Ray Ozzie Drinking Game”.&#160; You can take a drink* every time he said “Cloud” without getting arrested and pass out in your own comfortable chair.</li>
<li>When Ray gets boring (and he will), you can hop on over to YouTube and watch <a href="http://www.youtube.com/view_play_list?p=C8C29B40CA420773&amp;search_query=steve+ballmer+developers">Steve Ballmer</a> be <strong>not boring</strong>.</li>
</ol>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/wvsboPUjrGc&amp;hl=en_US&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/wvsboPUjrGc&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/tcdk0DW0EkQ&amp;hl=en_US&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/tcdk0DW0EkQ&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1026&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/xaeGadjfcVuEqmuonV1zHwen3wo/0/da"><img src="http://feedads.g.doubleclick.net/~a/xaeGadjfcVuEqmuonV1zHwen3wo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/xaeGadjfcVuEqmuonV1zHwen3wo/1/da"><img src="http://feedads.g.doubleclick.net/~a/xaeGadjfcVuEqmuonV1zHwen3wo/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=E9XIvBoTHL4:0p2C5SQd0po:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=E9XIvBoTHL4:0p2C5SQd0po:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=E9XIvBoTHL4:0p2C5SQd0po:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=E9XIvBoTHL4:0p2C5SQd0po:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=E9XIvBoTHL4:0p2C5SQd0po:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/E9XIvBoTHL4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2009/11/10-reasons-to-be-glad-youre-watching-the-pdc09-keynote-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2009/11/10-reasons-to-be-glad-youre-watching-the-pdc09-keynote-online/</feedburner:origLink></item>
		<item>
		<title>Silverlight Proof-of-my-Concept Update</title>
		<link>http://feedproxy.google.com/~r/ChristopherEstep/~3/VRyH90Z-SJA/</link>
		<comments>http://www.christopherestep.com/2009/11/silverlight-proof-of-my-concept-update/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 18:45:14 +0000</pubDate>
		<dc:creator>Christopher Estep</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://www.christopherestep.com/2009/11/silverlight-proof-of-my-concept-update/</guid>
		<description><![CDATA[I’ve been busy on my Silverlight test control and it’s been more fun than I’d expected and it’s actually been a lot easier than I’d expected, too.  So what I’ve been doing is delving into some of the more internal differences to extend what I’d originally planned further. From a layout perspective, Silverlight 3 is [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been busy on my Silverlight test control and it’s been more fun than I’d expected and it’s actually been a lot easier than I’d expected, too.  So what I’ve been doing is delving into some of the more internal differences to extend what I’d originally planned further.</p>
<p>From a layout perspective, Silverlight 3 is very similar to what I would do in WPF, but it’s much more basic.  You can do many of the same things, but with Sl, it’s pretty scaled down.  By this I mean that WPF is a richer framework and handles some of the details that you otherwise have to do manually in Silverlight.</p>
<p>One thing I’ve noticed is that Silverlight is very lean with its overloaded constructors.  I’m not complaining, it’s an observation.  I’ll give a real example.</p>
<p>In WPF, I could make a rotate transformation like this:</p>
<pre class="csharpcode">  child.RenderTransform = <span class="kwrd">new</span> RotateTransform((angle * 180 / Math.PI));</pre>
<p>The problem  with doing that in Silverlight is that RotateTransform only has the default constructor.  Fortunately, C# 3 included Object Initializers, so the alternate syntax I have to use is completely painless:</p>
<pre class="csharpcode">  child.RenderTransform = <span class="kwrd">new</span> RotateTransform()
       { Angle = (angle * 180 / Math.PI) };</pre>
<p>How awesome is that?</p>
<p>So you still have the benefit of a lighter footprint without the overloaded constructors (which are just get/set anyway in this case), but still painlessly instantiate and initialize the object.</p>
<p>There needs to be a word of caution to newer programmers.  Don’t assume that you can universally bypass all overloaded constructers using Object Initialization as I’ve done above.  While a significant number of such constructors are nothing more than get/set convenience mechanisms, this is not the case every time.</p>
<p>Object Initialization is easier to read than a parameterized, overloaded constructor.  Just don’t forget that constructors can (and often) do more than just initialize properties.</p>
<p>Know your code!</p>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --> <!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<img src="http://www.christopherestep.com/?ak_action=api_record_view&id=1022&type=feed" alt="" />
<p><a href="http://feedads.g.doubleclick.net/~a/4jdrnAsBNtr0NxYPIKddIcepgGA/0/da"><img src="http://feedads.g.doubleclick.net/~a/4jdrnAsBNtr0NxYPIKddIcepgGA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4jdrnAsBNtr0NxYPIKddIcepgGA/1/da"><img src="http://feedads.g.doubleclick.net/~a/4jdrnAsBNtr0NxYPIKddIcepgGA/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=VRyH90Z-SJA:To-lB2omdt0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=VRyH90Z-SJA:To-lB2omdt0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=VRyH90Z-SJA:To-lB2omdt0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/ChristopherEstep?a=VRyH90Z-SJA:To-lB2omdt0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/ChristopherEstep?i=VRyH90Z-SJA:To-lB2omdt0:V_sGLiPBpWU" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/ChristopherEstep/~4/VRyH90Z-SJA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.christopherestep.com/2009/11/silverlight-proof-of-my-concept-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.christopherestep.com/2009/11/silverlight-proof-of-my-concept-update/</feedburner:origLink></item>
	</channel>
</rss>
