<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/atom10full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CEQHQHo7cCp7ImA9WxRWEE0.&quot;"><id>tag:blogger.com,1999:blog-9534263</id><updated>2008-10-26T06:25:31.408Z</updated><title>compilewith.net</title><subtitle type="html">software by design</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://compilewith.net/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://compilewith.net/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>121</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/Compilewithnet" type="application/atom+xml" /><entry gd:etag="W/&quot;CUQMRnk6fCp7ImA9WxRXGU4.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-6590770041592405352</id><published>2008-10-25T12:12:00.001+01:00</published><updated>2008-10-25T12:16:27.714+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-25T12:16:27.714+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="News" /><category scheme="http://www.blogger.com/atom/ns#" term=".Net" /><title>New .NET logo</title><content type="html">&lt;p&gt;&amp;#160;&lt;img src="http://farm4.static.flickr.com/3019/2971540016_339232f55d_o.png" /&gt; &lt;/p&gt;  &lt;p&gt;See &lt;a href="http://blogs.msdn.com/msmossyblog/archive/2008/10/25/embrace-the-new-net-logo.aspx"&gt;here&lt;/a&gt; for more information.&lt;/p&gt;  &lt;p&gt;My initial reaction was: &lt;em&gt;now what do you wanna go and do that for...?&lt;/em&gt; But it's really growing on me... I think &lt;strong&gt;I like it&lt;/strong&gt;.&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=E7URM"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=E7URM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=E4DnM"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=E4DnM" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/431626430" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/6590770041592405352/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=6590770041592405352" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/6590770041592405352?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/6590770041592405352?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/431626430/new-net-logo.html" title="New .NET logo" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/10/new-net-logo.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIFQ3cyfyp7ImA9WxRQFU4.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-5256770884156099182</id><published>2008-10-07T13:07:00.001+01:00</published><updated>2008-10-09T07:08:32.997+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-09T07:08:32.997+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="News" /><category scheme="http://www.blogger.com/atom/ns#" term=".Net" /><title>ReMix UK 08 - the sessions...</title><content type="html">&lt;p&gt;I've posted about the &lt;a href="http://www.microsoft.com/uk/remix08"&gt;ReMix UK 08&lt;/a&gt; event hosted in Brighton &lt;a href="http://compilewith.net/2008/09/remix-uk-08-day-1.html"&gt;here&lt;/a&gt; and &lt;a href="http://compilewith.net/2008/09/remix-uk-08-day-2.html"&gt;here&lt;/a&gt;; the sessions are now available on-line from the ReMix Web site, on the agenda page: &lt;a title="http://www.microsoft.com/uk/remix08/agenda.aspx" href="http://www.microsoft.com/uk/remix08/agenda.aspx"&gt;http://www.microsoft.com/uk/remix08/agenda.aspx&lt;/a&gt;. Please check out my previous posts to get an idea of the sessions to watch out for.&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=3TD3M"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=3TD3M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=mYlyM"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=mYlyM" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/413753870" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/5256770884156099182/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=5256770884156099182" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/5256770884156099182?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/5256770884156099182?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/413753870/remix-uk-08-sessions.html" title="ReMix UK 08 - the sessions..." /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/10/remix-uk-08-sessions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UESHo5eip7ImA9WxRRF0s.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-8435357954526776076</id><published>2008-09-30T09:48:00.001+01:00</published><updated>2008-09-30T10:00:09.422+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-30T10:00:09.422+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Comment" /><category scheme="http://www.blogger.com/atom/ns#" term="Prism" /><title>What is in a name?</title><content type="html">&lt;p&gt;Whilst drinking my first cup of coffee this morning and browsing my &lt;a href="http://reader.google.com"&gt;daily feeds&lt;/a&gt;, it occurred to me that Prism as a moniker is far more extensible and composite in nature than the official title of the product: &lt;a href="http://www.codeplex.com/CompositeWPF"&gt;Composite WPF&lt;/a&gt;. The reason being that once you introduce Silverlight into the mix it's no longer Composite &lt;strong&gt;WPF&lt;/strong&gt;.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Composite Silverlight?  &lt;li&gt;Composite XAML?  &lt;li&gt;Composite .NET?&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I find it amusing that the "marketing" title for the product does not live up to the product that it &lt;em&gt;allegedly&lt;/em&gt; describes. Apparently for legal beagle reasons we cannot keep the lovely handle &lt;strong&gt;Prism&lt;/strong&gt; as a product name.&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=ZnvOL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=ZnvOL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=5f8rL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=5f8rL" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/407081915" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/8435357954526776076/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=8435357954526776076" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/8435357954526776076?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/8435357954526776076?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/407081915/what-in-name.html" title="What is in a name?" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/09/what-in-name.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIESXc7fCp7ImA9WxRREEo.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-222627419828723828</id><published>2008-09-22T10:08:00.001+01:00</published><updated>2008-09-22T10:08:28.904+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-22T10:08:28.904+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><category scheme="http://www.blogger.com/atom/ns#" term="News" /><category scheme="http://www.blogger.com/atom/ns#" term="Prism" /><title>Prism V2 - Drop 1</title><content type="html">&lt;p&gt;I have recently managed to get myself invited on to the &lt;a href="http://msdn.microsoft.com/practices"&gt;Microsoft patterns &amp;amp; practices&lt;/a&gt; advisory board for &lt;strong&gt;Composite WPF&lt;/strong&gt;, formerly known as &lt;strong&gt;Prism&lt;/strong&gt;. I consider my self very lucky to have been &lt;em&gt;invited&lt;/em&gt; to serve on the board so expect to start seeing more from me on this really great topic in the coming months. &lt;/p&gt; &lt;p&gt;My intention had been to wait until I'd at least managed to attend my first meeting of the board before announcing that I'd been invited to attend but the boys at p&amp;amp;p only went and shipped the &lt;a href="http://www.codeplex.com/CompositeWPF/Release/ProjectReleases.aspx?ReleaseId=17399"&gt;first drop of &lt;strong&gt;Prism V2&lt;/strong&gt;&lt;/a&gt;, forcing my hand by about a week!&lt;/p&gt; &lt;p&gt;If you're working with WPF today or just have a keen interest in designing composite applications please go and take a look at the &lt;strong&gt;Composite WPF&lt;/strong&gt; bits on CodePlex: &lt;a title="http://www.codeplex.com/CompositeWPF" href="http://www.codeplex.com/CompositeWPF"&gt;http://www.codeplex.com/CompositeWPF&lt;/a&gt;. I'm also posting all my links for anything related to &lt;strong&gt;Composite WPF&lt;/strong&gt; under the &lt;strong&gt;Prism&lt;/strong&gt; tag on delicious, which you can find here: &lt;a href="http://delicious.com/compilewith.net/Prism"&gt;http://delicious.com/compilewith.net/Prism&lt;/a&gt;. Enjoy!&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=PiVvL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=PiVvL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=RbSUL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=RbSUL" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/399635464" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/222627419828723828/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=222627419828723828" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/222627419828723828?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/222627419828723828?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/399635464/prism-v2-drop-1.html" title="Prism V2 - Drop 1" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://compilewith.net/2008/09/prism-v2-drop-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYBQ3s-fip7ImA9WxRSGU0.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-3292807163468158288</id><published>2008-09-20T11:46:00.000+01:00</published><updated>2008-09-20T11:55:52.556+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-20T11:55:52.556+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="News" /><title>ReMix UK 08 - Day 2</title><content type="html">&lt;p&gt;The second day started with a session by &lt;a href="http://weblogs.asp.net/scottgu/"&gt;ScottGu&lt;/a&gt; on &lt;a href="www.asp.net/mvc"&gt;ASP.NET MVC&lt;/a&gt;; the session itself was great and the technology shows some real promise. I actually skipped the next session I was going to go to, on IE8, to play with the MVC bits. Next up was the &lt;em&gt;Developer Speaker Panel&lt;/em&gt; with Scott, &lt;a href="http://blogs.msdn.com/saraford/"&gt;Sara Ford&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/mflasko/"&gt;Mike Flasko&lt;/a&gt;, who gave the &lt;a href="http://astoria.mslivelabs.com/"&gt;Astoria&lt;/a&gt; talk the day before, and another member of the Data team at Microsoft. Most questions ended up in Scott's lap and while he gave some great answers it was a pretty average session for me.&lt;/p&gt; &lt;p&gt;Next we went to lunch with &lt;a href="http://ux.artu.tv/"&gt;Arturo Toledo&lt;/a&gt;, and then afterwards we went to his session &lt;em&gt;Design with Microsoft Expression&lt;/em&gt;, which was really great; easily on a par with Scott's session that same morning. Then that was it, we were all done and left Brighton for home.&lt;/p&gt; &lt;p&gt;In conclusion I don't think there was a single winner with regards to the sessions; but if I had to choose it would have to be Bill's session &lt;i&gt;Designing for the Wild&lt;/i&gt; on the designer track, and Scott's &lt;em&gt;MVC&lt;/em&gt; session on the developer track. All in all it was great conference and I'd love to do it again next year.  &lt;p&gt;Now I'm just waiting for my &lt;i&gt;&lt;a href="http://compilewith.net/2008/09/microsoft-remix-uk-08.html"&gt;swag&lt;/a&gt;&lt;/i&gt; to arrive......&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=5ccaL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=5ccaL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=VNgVL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=VNgVL" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/398035859" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/3292807163468158288/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=3292807163468158288" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/3292807163468158288?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/3292807163468158288?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/398035859/remix-uk-08-day-2.html" title="ReMix UK 08 - Day 2" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/09/remix-uk-08-day-2.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cERnc4fCp7ImA9WxRSGEw.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-7236445615506064052</id><published>2008-09-19T00:00:00.000+01:00</published><updated>2008-09-19T11:10:07.934+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-19T11:10:07.934+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="News" /><title>ReMix UK 08 - Day 1</title><content type="html">&lt;p&gt;The keynote was awesome, the surprise for me was Bill Buxton; I'd not really heard of him much before today and he was a real pleasure to watch. ScottGu was as awesome as ever, and it was really fantastic to meet him in person.&lt;/p&gt; &lt;p&gt;I went to four sessions today:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Introduction to Silverlight 2 - Part 1&lt;/strong&gt;. I wanted to go to this one to see ScottGu speak, and surprisingly I learnt a couple of things (iframe presence to fix a bug in older Safari browsers and their expected control release plans) that actually made the whole session worthwhile.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Designing in the Wild: Sketching Experiences&lt;/strong&gt;. This session was the highlight of the day for me. Bill is an inspirational speaker; I learnt loads about design and designers and how to think about design... and that I'm not a designer, and unlikely to ever be one.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;ADO.NET Data Services (Astoria)&lt;/strong&gt;. This was the best technical presentation of the day! This technology is amazing and is live and available for use today by using .NET 3.5. &lt;em&gt;JP you really need to look at this&lt;/em&gt;.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Design Panel&lt;/strong&gt;. I had a choice of this session or the VS IDE Tips and Tricks by Sara Ford, which was the session that I intended to go to - but Bill so impressed me that I wanted to hear more from him.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;All in all it was a great day, I really enjoyed the whole thing, looking forward to more sessions tomorrow.&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=YfWIL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=YfWIL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=Vh3gL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=Vh3gL" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/397089188" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/7236445615506064052/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=7236445615506064052" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/7236445615506064052?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/7236445615506064052?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/397089188/remix-uk-08-day-1.html" title="ReMix UK 08 - Day 1" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/09/remix-uk-08-day-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4BR38-eip7ImA9WxRSFUo.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-7108466292014565083</id><published>2008-09-16T14:47:00.001+01:00</published><updated>2008-09-16T14:49:16.152+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-16T14:49:16.152+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="News" /><title>New look...</title><content type="html">&lt;p&gt;...the new look is now &lt;a href="http://compilewith.net/"&gt;live&lt;/a&gt;. I'm still not completely done hacking on it yet, but it's baked enough that I just wanted to get it out there. I'd love to get your feedback, be it good, bad or indifferent.&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=RvzOL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=RvzOL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=2Ip2L"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=2Ip2L" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/394230468" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/7108466292014565083/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=7108466292014565083" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/7108466292014565083?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/7108466292014565083?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/394230468/new-look.html" title="New look..." /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/09/new-look.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8CSHo9eip7ImA9WxRSEU8.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-8528422326902836580</id><published>2008-09-11T10:54:00.001+01:00</published><updated>2008-09-11T10:54:29.462+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-11T10:54:29.462+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="News" /><category scheme="http://www.blogger.com/atom/ns#" term=".Net" /><title>Microsoft ReMix UK 08</title><content type="html">&lt;p&gt;&lt;a href="http://www.microsoft.com/uk/remix08/default.aspx"&gt;&lt;img src="http://www.microsoft.com/uk/remix08/images/remix_uk_logo.gif"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;18-19 September 2008 | Brighton&lt;/p&gt; &lt;p&gt;See you &lt;a href="http://www.microsoft.com/uk/remix08/default.aspx"&gt;there&lt;/a&gt;?&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=eYdZL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=eYdZL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=TTjtL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=TTjtL" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/389517582" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/8528422326902836580/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=8528422326902836580" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/8528422326902836580?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/8528422326902836580?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/389517582/microsoft-remix-uk-08.html" title="Microsoft ReMix UK 08" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total><feedburner:origLink>http://compilewith.net/2008/09/microsoft-remix-uk-08.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEHQn4-fyp7ImA9WxRSFUo.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-2872596878951822091</id><published>2008-09-02T12:42:00.001+01:00</published><updated>2008-09-16T14:43:53.057+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-16T14:43:53.057+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Technology" /><category scheme="http://www.blogger.com/atom/ns#" term="Off Topic" /><title>Evernote - My Public Notebook</title><content type="html">&lt;p&gt;&lt;img src="http://www.evernote.com/about/img/logo.gif"&gt; &lt;/p&gt; &lt;p&gt;I've been using &lt;a href="http://www.evernote.com/"&gt;Evernote&lt;/a&gt; for a couple of months now and I think it's an absolutely brilliant tool for keeping notes. &lt;a href="http://www.matanza.net/"&gt;Matt&lt;/a&gt; introduced me to it and I'm glad he did; he talks about how much &lt;a href="http://www.matanza.net/?p=60"&gt;he's loving it too&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;Like Matt, previously I used &lt;a href="http://office.microsoft.com/onenote"&gt;Microsoft OneNote&lt;/a&gt; (which I introduced &lt;em&gt;him&lt;/em&gt; to a while back, heh); At first I saw no reason to change, I just thought I'd give it a go for a while, take it out for a spin. I don't really know why I did, I was really happy with OneNote. &lt;/p&gt; &lt;p&gt;But Evernote has one &lt;em&gt;killer&lt;/em&gt; feature that has made me a convert (even if it does have a &lt;em&gt;much&lt;/em&gt; smaller feature set):&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;Evernote is everywhere!&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;And that's it hold over me, that's why I probably won't be going back to OneNote. Evernote is simply and truly everywhere - in the cloud, on my desktop, on my phone, on my laptop. Like the &lt;a href="http://www.mesh.com"&gt;Mesh&lt;/a&gt;, &lt;a href="http://delicious.com/compilewith.net"&gt;Delicious&lt;/a&gt;, &lt;a href="http://www.flickr.com"&gt;Flickr&lt;/a&gt;, &lt;a href="http://www.skype.com"&gt;Skype&lt;/a&gt; and &lt;a href="http://www.box.net/"&gt;Box.NET&lt;/a&gt; before it Evernote has found it's way on to my list of indispensable tools for living and working in the cloud.&lt;/p&gt; &lt;p&gt;Find my public Evernote notebook here:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;a title="http://www.evernote.com/pub/pjackson/compilewith.net" href="http://www.evernote.com/pub/pjackson/compilewith.net"&gt;http://www.evernote.com/pub/pjackson/compilewith.net&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=ImfRRL"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=ImfRRL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=UVIx5L"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=UVIx5L" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/381298738" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/2872596878951822091/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=2872596878951822091" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/2872596878951822091?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/2872596878951822091?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/381298738/evernote-my-public-notebook.html" title="Evernote - My Public Notebook" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/09/evernote-my-public-notebook.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EFSHk4fip7ImA9WxRSFUo.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-2909573502108544067</id><published>2008-08-28T09:55:00.001+01:00</published><updated>2008-09-16T14:26:59.736+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-16T14:26:59.736+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Off Topic" /><title>Where did that Microsoft Word feature go...?</title><content type="html">&lt;p&gt;I use Microsoft Word 2007 (and PowerPoint for that matter) a lot in my day job, and I think I've got a pretty good handle on where things are now since the invention of the Ribbon. However, there are still times where I think: &lt;/p&gt; &lt;blockquote&gt; &lt;b&gt;Now, where the &lt;em&gt;%"@#'$&lt;/em&gt; has that menu option moved to...&lt;/b&gt;&lt;/blockquote&gt; &lt;p&gt;Here is a little application where you find the feature you want in a mock up of the Word 2003 interface and it'll show you where it is now in Word 2007, awesome.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://office.microsoft.com/assistance/asstvid.aspx?assetid=XT100766331033&amp;amp;vwidth=1044&amp;amp;vheight=788&amp;amp;type=flash&amp;amp;CTT=11&amp;amp;Origin=HA100744321033"&gt;Microsoft Office Online&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I don't know how long this has been available, but I hope it'll save you some time and frustration when trying to find those missing or moved Word features. &lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=Q8ENwK"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=Q8ENwK" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=5KrBkK"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=5KrBkK" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/376966609" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/2909573502108544067/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=2909573502108544067" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/2909573502108544067?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/2909573502108544067?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/376966609/where-did-that-microsoft-word-feature.html" title="Where did that Microsoft Word feature go...?" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/08/where-did-that-microsoft-word-feature.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cHRnYzeyp7ImA9WxRSFUo.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-959607410622150799</id><published>2008-08-08T12:47:00.001+01:00</published><updated>2008-09-16T14:17:17.883+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-16T14:17:17.883+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Silverlight" /><title>Silverlight 2 and a new look Web site...</title><content type="html">&lt;p&gt;Things have been decidedly busy over last month or so making my posts a little sparse - or more accurately non-existent - I have been working with &lt;a href="http://silverlight.net"&gt;Silverlight&lt;/a&gt; 2 beta 2; I certainly like what I see, even if it's not quite there yet, compared with WPF that is, it shows real promise. &lt;span class="indexonly"&gt;[...snip...]&lt;/span&gt;&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;p&gt;However, the jewel in the crown for me is the integration of the &lt;a href="http://labs.live.com/Silverlight+2+Deep+Zoom.aspx"&gt;DeepZoom&lt;/a&gt; technology (previously known as &lt;a href="http://labs.live.com/Seadragon.aspx"&gt;SeaDragon&lt;/a&gt;), it is truly awesome! Just check out what the boys and girls at Vertigo have put together (pay special attention to the Hard Rock Memorabilia sample): &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;a title="http://www.vertigo.com/Silverlight.aspx" href="http://www.vertigo.com/Silverlight.aspx"&gt;http://www.vertigo.com/Silverlight.aspx&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;As for my own endeavours, over last couple of weeks I've been working on some new designs for this Web site - the style and template I've been using since the inception of this site is a pre-canned template that comes with the Blogger offering. Whilst it's OK I've grown a tad bored of it and the restrictions it places on my posts (content area width, and *very* un-code friendly) I thought it was about time that I did my own design.&lt;/p&gt; &lt;p&gt;Here's the tie in with DeepZoom: I've created an application to show-off the five designs that I've come up with (you can also find the designs on &lt;a href="http://www.flickr.com/photos/paulja/tags/designs"&gt;Flickr&lt;/a&gt;). I've used the free &lt;a href="http://silverlight.live.com/"&gt;Silverlight Streaming&lt;/a&gt; service to host the application:&lt;/p&gt; &lt;p&gt;&lt;a title="DeepZoomSiteDesigns" href="http://code.compilewith.net/sitedesigns.html"&gt;&lt;img border="0" alt="DeepZoomSiteDesigns" src="http://static.flickr.com/3137/2743234641_6c1af3eace.jpg" width="240" height="181"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Click the image above or &lt;a href="http://code.compilewith.net/sitedesigns.html"&gt;here&lt;/a&gt; to see the application in it's full glory. &lt;/p&gt; &lt;p&gt;I've also had a bunch of my friends (thank you!) review and critique my original designs, and with some final tweaks I'm down to a shortlist of two, and here they are (in order of my personal preference):&lt;/p&gt; &lt;p&gt;&lt;a title="compilewith.net.6" href="http://www.flickr.com/photos/paulja/2738361008/sizes/o/"&gt;&lt;img border="0" alt="compilewith.net.6" src="http://static.flickr.com/3247/2738361008_8856f3c550.jpg" width="480" height="362"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a title="compilewith.net.7" href="http://www.flickr.com/photos/paulja/2737524531/sizes/o/"&gt;&lt;img border="0" alt="compilewith.net.7" src="http://static.flickr.com/3044/2737524531_6529b7b76c.jpg" width="480" height="364"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can click the images to see them full size. My plan is to live with both these designs for a couple of weeks, after that time I'll pick one and prototype it.&lt;/p&gt; &lt;p&gt;I would love to know your thoughts on DeepZoom and the remaining two designs (both positive and negative), my view is the more feedback I get the better.&lt;/p&gt;&lt;/span&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=FOGHDK"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=FOGHDK" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=FnZ6pK"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=FnZ6pK" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/359355029" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/959607410622150799/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=959607410622150799" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/959607410622150799?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/959607410622150799?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/359355029/silverlight-2-and-new-look-web-site.html" title="Silverlight 2 and a new look Web site..." /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/08/silverlight-2-and-new-look-web-site.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4BQX0_fCp7ImA9WxRSFUo.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-4325097301124816903</id><published>2008-07-21T15:56:00.001+01:00</published><updated>2008-09-16T14:15:50.344+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-16T14:15:50.344+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><title>WPF - Data-binding a lesson in framework design</title><content type="html">&lt;p&gt;In WPF we tend to take data-binding for granted. It is just one of those features that &lt;em&gt;just works&lt;/em&gt;. In this post I want to briefly bring your attention to how the data-binding system works with regards to non-&lt;strong&gt;FrameworkElement&lt;/strong&gt; derived classes, not because you need to know to be able to use it, but because I think it has all the hallmarks of a good API design. &lt;span class="indexonly"&gt;[...snip...]&lt;/span&gt;&lt;/p&gt; &lt;span class="fullpost"&gt;&lt;p&gt;Consider this XAML:&lt;/p&gt; &lt;p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;Page &lt;br&gt;&amp;nbsp; xmlns="&lt;/font&gt;&lt;font face="Verdana"&gt;..."&lt;/font&gt;&lt;br&gt;&lt;font face="Consolas"&gt;&amp;nbsp; xmlns:x="&lt;/font&gt;&lt;font face="Verdana"&gt;..."&lt;/font&gt;&lt;br&gt;&lt;font face="Consolas"&gt;&amp;nbsp; xmlns:sys="clr-namespace:System;assembly=mscorlib"&amp;gt; &lt;/font&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;nbsp; &amp;lt;StackPanel x:Name="panel"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ListBox x:Name="colors" Margin="10"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sys:String&amp;gt;Black&amp;lt;/sys:String&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sys:String&amp;gt;Red&amp;lt;/sys:String&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sys:String&amp;gt;Green&amp;lt;/sys:String&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sys:String&amp;gt;Blue&amp;lt;/sys:String&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ListBox&amp;gt; &lt;/font&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text="{Binding SelectedItem, ElementName=colors}" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FontSize="36" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Margin="10"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock.Foreground&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SolidColorBrush &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Color="{Binding SelectedItem, ElementName=colors}" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/TextBlock.Foreground&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/TextBlock&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/StackPanel&amp;gt;&lt;br&gt;&amp;lt;/Page&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;If you put this XAML straight into something like &lt;a href="http://www.charlespetzold.com/wpf/XamlCruncher/XamlCruncher.application"&gt;XamlCruncher&lt;/a&gt; or &lt;a href="http://www.kaxaml.com/"&gt;Kaxaml&lt;/a&gt; (XamPad doesn't quite cut it because of the external reference to &lt;em&gt;MSCoreLib&lt;/em&gt;) you end up with something like this:&lt;/p&gt; &lt;p&gt;&lt;img alt="DataBindingToBrushName" src="http://static.flickr.com/3098/2689445400_a5c90a8eb3.jpg" border="0"&gt;&lt;/p&gt; &lt;p&gt;When you click the items in the &lt;strong&gt;ListBox&lt;/strong&gt;, the &lt;strong&gt;TextBlock &lt;/strong&gt;foreground colour changes and so does the text.&lt;/p&gt; &lt;p&gt;Great, data-binding in action - a somewhat contrived example but it works as you would expect. However, things get a little more interesting when you try and achieve the same effect in procedural code. &lt;/p&gt; &lt;p&gt;Setting the &lt;strong&gt;TextBlock&lt;/strong&gt; text is simple enough as &lt;strong&gt;TextBlock &lt;/strong&gt;is derived from &lt;strong&gt;FrameworkElement&lt;/strong&gt; that has a &lt;strong&gt;SetBinding &lt;/strong&gt;method that we can use - we would write code similar to the following:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&lt;strong&gt;// Create the binding&lt;/strong&gt;&lt;br&gt;&lt;em&gt;Binding colorsBinding = new Binding();&lt;br&gt;colorsBinding.Source = this.colors;&lt;br&gt;colorsBinding.Path = new PropertyPath("SelectedItem"); &lt;/em&gt;&lt;/font&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&lt;strong&gt;// Create the TextBlock&lt;br&gt;&lt;/strong&gt;TextBlock tb = new TextBlock();&lt;br&gt;tb.FontSize = 36;&lt;br&gt;tb.Margin = new Thickness(10); &lt;/font&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&lt;strong&gt;// Bind the TextProperty to the ListBox.SelectedValue&lt;br&gt;&lt;/strong&gt;&lt;em&gt;tb.SetBinding(TextBlock.TextProperty, colorsBinding);&lt;/em&gt;&lt;/font&gt;&lt;em&gt; &lt;/em&gt; &lt;p&gt;This code is considerably more verbose than using the lovely data-binding XAML syntax, but it should be clear what's going on. Here's the equivalent XAML, as we saw above:&lt;/p&gt;&lt;font face="Consolas"&gt;&amp;lt;TextBlock &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text="{Binding SelectedItem, ElementName=colors}" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FontSize="36" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Margin="10"&amp;gt;&lt;br&gt;&lt;/font&gt; &lt;p&gt;This would render as:&lt;/p&gt; &lt;p&gt;&lt;img alt="DataBindingToBrushName2" src="http://static.flickr.com/3136/2689445340_a18190e08c.jpg" border="0"&gt;&lt;/p&gt; &lt;p&gt;Note the lack of colour, let's do that next. We can use the same &lt;strong&gt;Binding&lt;/strong&gt; class instance as before and apply it to the &lt;strong&gt;ColorProperty&lt;/strong&gt; dependency property on the &lt;strong&gt;SolidColorBrush&lt;/strong&gt; class, then apply that brush to the &lt;strong&gt;TextBlock&lt;/strong&gt; instance, as shown here:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;SolidColorBrush brush = new SolidColorBrush();&lt;br&gt;&lt;strong&gt;brush.SetBinding(SolidColorBrush.ColorProperty, colorsBinding);&lt;br&gt;&lt;/strong&gt;tb.Foreground = brush;&lt;/font&gt;  &lt;p&gt;However, if you try and compile this code your compiler will complain that &lt;strong&gt;SolidColorBrush&lt;/strong&gt; does not have a &lt;strong&gt;SetBinding&lt;/strong&gt; method. This is because &lt;strong&gt;SolidColorBrush&lt;/strong&gt; derives from &lt;strong&gt;Brush&lt;/strong&gt;, which derives from &lt;strong&gt;Animatable&lt;/strong&gt;, and then from &lt;strong&gt;Freezable&lt;/strong&gt;, before we finally hit &lt;strong&gt;DependenyObject&lt;/strong&gt;:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;DependencyObject  &lt;ul&gt; &lt;li&gt;Freezable  &lt;ul&gt; &lt;li&gt;Animatable  &lt;ul&gt; &lt;li&gt;Brush  &lt;ul&gt; &lt;li&gt;SolidColorBrush&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;But &lt;strong&gt;TextBlock&lt;/strong&gt; has a somewhat different lineage:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;DependencyObject  &lt;ul&gt; &lt;li&gt;Visual&amp;nbsp; &lt;ul&gt; &lt;li&gt;Animatable  &lt;ul&gt; &lt;li&gt;UIElement&amp;nbsp; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;&lt;em&gt;FrameworkElement&lt;/em&gt;&lt;/strong&gt;  &lt;ul&gt; &lt;li&gt;TextBlock&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;So what's the story here, these two objects only have &lt;strong&gt;DependencyObject&lt;/strong&gt; in their common ancestry, and that class does not have the necessary &lt;strong&gt;SetBinding&lt;/strong&gt; method, how can the binding possibly work at all?&lt;/p&gt; &lt;p&gt;If you were to look at the implementation code for the &lt;strong&gt;SetBinding&lt;/strong&gt; method in &lt;strong&gt;FrameworkElement&lt;/strong&gt; the answer would immediately present itself:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;public BindingExpressionBase SetBinding(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DependencyProperty dp, &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BindingBase binding)&lt;br&gt;{&lt;br&gt;&lt;em&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/em&gt;&lt;strong&gt;&lt;em&gt;return BindingOperations.SetBinding(this, dp, binding);&lt;br&gt;&lt;/em&gt;&lt;/strong&gt;}&lt;/font&gt;  &lt;p&gt;&lt;strong&gt;BindingOperations.SetBinding&lt;/strong&gt;, this static method asks for a target dependency object, a dependency property and a binding instance. So we should be able to re-write our previous code to use this class directly, like this:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;SolidColorBrush brush = new SolidColorBrush();&lt;br&gt;&lt;strong&gt;&lt;em&gt;BindingOperations.SetBinding(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; brush, SolidColorBrush.ColorProperty, colorsBinding);&lt;br&gt;&lt;/em&gt;&lt;/strong&gt;tb.Foreground = brush;&lt;/font&gt;  &lt;p&gt;Which works as expected, therefore the visual outcome is the same as above, but this time the effect is achieved by using procedural code:&lt;/p&gt; &lt;p&gt;&lt;img alt="DataBindingToBrushName" src="http://static.flickr.com/3098/2689445400_a5c90a8eb3.jpg" border="0"&gt;&lt;/p&gt; &lt;p&gt;Now we understand what is going on a little better how does this helps us? "So what?" you might ask. You can still write the same XAML there's nothing new there; learning this has not changed a single thing for you when it comes to data-binding, it just works. It is exactly the &lt;em&gt;it just works&lt;/em&gt; aspect of the data-binding design I think is soooo important in this implementation. &lt;/p&gt; &lt;p&gt;The designers of the data-binding API put the convenience method (&lt;strong&gt;SetBinding&lt;/strong&gt;) in exactly the right place to make sense for the object model (&lt;strong&gt;&lt;em&gt;high cohesion&lt;/em&gt;&lt;/strong&gt;); but they implemented the feature in such a way that it's not tied to that specific scenario, meaning that have enabled &lt;em&gt;many&lt;/em&gt; scenarios with only the absolutely minimum requirements or contract being placed on the API, therefore &lt;strong&gt;&lt;em&gt;loosely coupled&lt;/em&gt;&lt;/strong&gt;. Brilliant! &lt;/p&gt; &lt;p&gt;Every single day I learn more about WPF and every day I appreciate the quality of the framework design. Enjoy and learn from a great design, I know I will.&lt;/p&gt;&lt;/span&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=8O1A6J"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=8O1A6J" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=3YI59J"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=3YI59J" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/341610922" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/4325097301124816903/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=4325097301124816903" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/4325097301124816903?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/4325097301124816903?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/341610922/wpf-data-binding-lesson-in-framework.html" title="WPF - Data-binding a lesson in framework design" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/07/wpf-data-binding-lesson-in-framework.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkANRn0_eip7ImA9WxRSFUo.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-2487196576509068828</id><published>2008-07-03T09:53:00.001+01:00</published><updated>2008-09-16T14:13:17.342+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-16T14:13:17.342+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><title>WPF - Selecting TreeViewItems in code</title><content type="html">&lt;p&gt;This appears to be a common problem for people with various solutions, most involving some walking of the visual tree, which to my mind is a little overkill. Also, you've got to wonder what the WPF team were thinking when they left out such a core (and apparently much demanded) feature, so there has to be an easier way, right? &lt;span class="indexonly"&gt;[...snip...]&lt;/span&gt;&lt;/p&gt; &lt;span class="fullpost"&gt;&lt;p&gt;As with most things like this you rarely find a complete solution in a single location, but that is what this post (and possibly a one or two more) will give you - which will not involve walking the visual tree, but will actually leverage the WPF data binding engine.&lt;/p&gt; &lt;p&gt;Let us start with the application scenario, to give us something to work with. Consider the following XML:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;br&gt;&amp;lt;Library&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Author Name="Edward Tufte"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="The Visual Display of ..." /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="Envisioning Information" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="Visual Explanations" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="Beautiful Evidence" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Author&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Author Name="Chris Sells"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="Windows Forms Programming in C#" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="Windows Forms 2.0 Programming" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="Programming WPF" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Author&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Author Name="Charles Petzold"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="Programming Microsoft Windows with C#" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="Application = Code + Markup" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Book Name="3D Programming for Windows" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Author&amp;gt;&lt;br&gt;&amp;lt;/Library&amp;gt;&lt;/font&gt;  &lt;p&gt;A very simple schema for a library of books. Our first step is to get this data into a &lt;strong&gt;TreeView&lt;/strong&gt;. We'll use CLR objects, rather than XML directly (the reasoning for this will be apparent later) - so lets assume that there is an appropriate object model of CLR objects to support this data schema, something like:&lt;/p&gt; &lt;center&gt;&lt;img border="0" alt="LibraryDataModel" src="http://static.flickr.com/3071/2630548035_ef7650f2a9.jpg"&gt;&lt;/center&gt; &lt;p&gt;To wire a &lt;strong&gt;TreeView&lt;/strong&gt; and this object model together is pretty straight forward: we provide the &lt;strong&gt;TreeView&lt;/strong&gt; with a &lt;strong&gt;HierarchicalDataTemplate&lt;/strong&gt;, something like this:&lt;/p&gt;&lt;font face="Consolas"&gt;&lt;font color="#808080"&gt;&amp;lt;TreeView x:Name="tree"&amp;gt; &lt;br&gt;&amp;nbsp; &amp;lt;TreeView.Resources&amp;gt;&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;HierarchicalDataTemplate&lt;font face="Consolas"&gt;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataType="{x:Type &lt;em&gt;ld:Author&lt;/em&gt;}"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff8000"&gt;ItemsSource="{Binding Path=Books}&lt;/font&gt;"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#808080"&gt;&amp;lt;TextBlock Text="{Binding Name}" /&amp;gt;&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/HierarchicalDataTemplate&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DataTemplate DataType="{x:Type &lt;em&gt;ld:Book&lt;/em&gt;}"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TextBlock Text="{Binding Title}" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DataTemplate&amp;gt;&lt;br&gt;&lt;font color="#808080"&gt;&amp;nbsp; &amp;lt;/TreeView.Resources&amp;gt;&lt;br&gt;&amp;lt;/TreeView&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#808080"&gt;&amp;nbsp;&lt;/font&gt;&amp;nbsp;&lt;/font&gt;  &lt;p&gt;The only significant difference between a &lt;strong&gt;DataTemplate&lt;/strong&gt; and a &lt;strong&gt;HierarchicalDataTemplate&lt;/strong&gt; is the &lt;em&gt;ItemsSource&lt;/em&gt; property; this simply tells the &lt;strong&gt;TreeView&lt;/strong&gt; where to get the children for the templated item from, the &lt;em&gt;Books&lt;/em&gt; property in this example.&lt;/p&gt; &lt;p&gt;Next we must provide the &lt;strong&gt;TreeView &lt;/strong&gt;with its &lt;em&gt;ItemsSource&lt;/em&gt;, which is the list of &lt;strong&gt;Authors&lt;/strong&gt;; some like this:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;private void OnLoaded(object sender, RoutedEventArgs e)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp; this.tree.ItemsSource = DataProvider.GetAuthors();&lt;br&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;This will produce an output similar to the following:&lt;/p&gt; &lt;p&gt;&lt;img border="0" alt="LibraryTreeViewOutput" src="http://static.flickr.com/3041/2631369678_c7c766ce23.jpg"&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Right, so that's the basic application, lets start trying to tackle the actual problem. &lt;/p&gt; &lt;p&gt;Before we go too much further we need to talk a little bit about what makes up a &lt;strong&gt;TreeView&lt;/strong&gt;. The important thing to understand for this solution is that each tree node is actually a type called &lt;strong&gt;TreeViewItem&lt;/strong&gt;, and it is this item that displays the data template we defined earlier for our custom types &lt;strong&gt;Author&lt;/strong&gt; and &lt;strong&gt;Book&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;&lt;a title="TreeViewExplained" href="http://farm4.static.flickr.com/3087/2630638325_17e47c1bdc_o.jpg"&gt;&lt;img border="0" alt="TreeViewExplained" src="http://static.flickr.com/3087/2630638325_66c01c5e7a.jpg" width="440" height="298"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;So you should be able to see from the image above (click on it to see a lager version) is that the &lt;strong&gt;TreeViewItem&lt;/strong&gt; is the container for our content. The &lt;strong&gt;TreeView&lt;/strong&gt; kindly provides a simple way for us to work with the &lt;strong&gt;TreeViewItem&lt;/strong&gt; indirectly by using the &lt;strong&gt;TreeView.ItemsContainerStyle&lt;/strong&gt;. This property enables us to modify the style associated with the &lt;strong&gt;TreeViewItem&lt;/strong&gt; template - remember that a &lt;em&gt;Style&lt;/em&gt; tweaks the properties on UI elements that the &lt;em&gt;Template&lt;/em&gt; loaded in the visual tree to render our view. Simply put: a &lt;em&gt;Style&lt;/em&gt; work with objects already in the visual tree by changing the values of (dependency) properties.&lt;/p&gt; &lt;p&gt;What this means for us is that the &lt;strong&gt;TreeViewItem&lt;/strong&gt; has two properties that we can use: &lt;em&gt;IsSelected&lt;/em&gt; and &lt;em&gt;IsExpanded&lt;/em&gt;, if we bind our business objects to these two properties via the &lt;em&gt;ItemsContainerStyle&lt;/em&gt; like so:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;TreeView x:Name="tree"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TreeView.ItemContainerStyle&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Style TargetType="{x:Type TreeViewItem}"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Setter &lt;font color="#ff8000"&gt;Property="IsSelected" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value="{Binding IsSelected}"&lt;/font&gt; /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Setter &lt;font color="#ff8000"&gt;Property="IsExpanded" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value="{Binding IsExpanded}"&lt;/font&gt; /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Style&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/TreeView.ItemContainerStyle&amp;gt;&lt;/font&gt;  &lt;p&gt;We can effect the behaviour of the tree buy manipulating our business objects! To make this all work we need to add these two properties to all the business objects that can appear in the tree control, &lt;strong&gt;Author&lt;/strong&gt; and &lt;strong&gt;Book &lt;/strong&gt;in this case. Then we must add change notification for the binding system to notice when we update these properties, which will then in turn update the tree control. Here's the new data model:&lt;/p&gt; &lt;p&gt;&lt;img border="0" alt="LibraryDataModelWithChangeNotification" src="http://static.flickr.com/3023/2631574580_35839802ae.jpg"&gt;&lt;/p&gt; &lt;p&gt;With all this in place, we're all set to manipulate the tree by using our data model. For example, when the application loads, the tree nodes are all collapsed (&lt;em&gt;IsExpanded&lt;/em&gt; defaults to &lt;strong&gt;false&lt;/strong&gt;), therefore to expand all the &lt;strong&gt;Author&lt;/strong&gt; nodes and to select the &lt;strong&gt;Book &lt;/strong&gt;with the title "&lt;em&gt;Beautiful Evidence&lt;/em&gt;" we would write the following code:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;foreach (&lt;em&gt;Author&lt;/em&gt; a in this.tree.ItemsSource)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff8000"&gt;a.IsExpanded = true;&lt;/font&gt; &lt;/font&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (a.Name == "Edward Tufte")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (&lt;em&gt;Book&lt;/em&gt; b in a.Books)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (b.Title == "Beautiful Evidence")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff8000"&gt;b.IsSelected = true;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;  &lt;p&gt;Running this code should produce something that looks like this:&lt;/p&gt; &lt;center&gt;&lt;img border="0" alt="LibraryTreeViewRunning" src="http://static.flickr.com/3106/2631598768_548ba84f79.jpg"&gt;&lt;/center&gt; &lt;p&gt;Here's the complete code for this simple example, note that this code is just the bare bones of what we've been talking about in this post, it's far from production code:&lt;/p&gt; &lt;center&gt;&lt;a href="http://www.box.net/shared/jr732d28g4"&gt;PaulJ.TreeViewManipulation.zip&lt;/a&gt;&lt;/center&gt; &lt;p&gt;This is not the end of the story, however. This solution is still a little &lt;a href="http://dictionary.reference.com/browse/sucky"&gt;sucky&lt;/a&gt;, due to the tight coupling between the data model and the requirements of the UI by way of the &lt;strong&gt;TreeViewItem&lt;/strong&gt;; the current data model would not be great for reuse in a WCF service or a Silverlight application for example. &lt;/p&gt; &lt;p&gt;Therefore in future post we'll look at tackling the &lt;a href="http://en.wikipedia.org/wiki/Separation_of_concerns"&gt;separation of concerns&lt;/a&gt; with a couple of design patterns, probably the &lt;a href="http://www.dofactory.com/Patterns/PatternDecorator.aspx"&gt;Decorator pattern&lt;/a&gt; (regular readers would have heard that story before) and the most likely &lt;em&gt;sound&lt;/em&gt; solution, in my opinion, will probably be a &lt;a href="http://en.wikipedia.org/wiki/Model-view-controller"&gt;Model View Controller&lt;/a&gt; approach, but we'll see - we can figure it out together.&lt;/p&gt; &lt;p&gt;Until next time, enjoy!&lt;/p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fcompilewith.net%2f2008%2f07%2fwpf-selecting-treeviewitems-in-code.html"&gt;&lt;img border="0" alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fcompilewith.net%2f2008%2f07%2fwpf-selecting-treeviewitems-in-code.html"&gt;&lt;/a&gt;&lt;/span&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=kjJiNJ"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=kjJiNJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=qLqa5J"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=qLqa5J" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/325634432" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/2487196576509068828/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=2487196576509068828" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/2487196576509068828?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/2487196576509068828?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/325634432/wpf-selecting-treeviewitems-in-code.html" title="WPF - Selecting TreeViewItems in code" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/07/wpf-selecting-treeviewitems-in-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UMQ385fyp7ImA9WxdbF0U.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-5833783130620435871</id><published>2008-06-30T11:57:00.001+01:00</published><updated>2008-08-15T08:28:02.127+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-15T08:28:02.127+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="News" /><title>Windows Live Writer del.icio.us Plug-In...an update</title><content type="html">&lt;p&gt;&lt;em&gt;&lt;strong&gt;UPDATE 2008-08-14:&lt;/strong&gt; When the boys at &lt;/em&gt;&lt;a href="http://delicious.com/"&gt;&lt;em&gt;Delicious&lt;/em&gt;&lt;/a&gt;&lt;em&gt; updated their site recently (nice work BTW, it looks great) they also changed their URL for feeds, causing my plug-in to break :-(&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;I have fixed up the code; the download links to the code on the original post are all correct and contain the updated code. The boys at Windows Live are currently approving the new upload, so please check to make sure you're downloading v1.1 if you get the plug-in from the link in this post.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Sorry for any hassle this may have caused. &amp;lt;/PJ&amp;gt;&lt;/em&gt;&lt;/p&gt; &lt;p&gt;When I wrote &lt;a href="http://compilewith.net/2008/06/windows-live-writer-plug-ins-wpf-code.html" target="_blank"&gt;the original post&lt;/a&gt; on the WLW plug-in, I had no intention of releasing it publicly; it was all about the process of building software and coding in general, I just needed a &lt;em&gt;real&lt;/em&gt; piece of &lt;img style="margin: 5px 0px 5px 25px" height="179" alt="WLWDPI.jpg" src="http://static.flickr.com/3062/2587529346_a4a4e57812_m.jpg" width="200" align="right" border="0"&gt;software to focus on for the post. However, after a brief conversion with &lt;a href="http://cloudstore.blogspot.com/" target="_blank"&gt;Derek&lt;/a&gt;, the other day, I spent 10 minutes packaging it all up, and then&amp;nbsp; submitted it to the &lt;a href="http://gallery.live.com/" target="_blank"&gt;Windows Live Gallery&lt;/a&gt;... it was accepted over the weekend:&lt;/p&gt; &lt;center&gt;&lt;a href="http://gallery.live.com/LiveItemDetail.aspx?li=95df4d4e-bfa2-430e-9162-517447aed3a8" target="_blank"&gt;del.icio.us Plug-In&lt;/a&gt;&lt;/center&gt; &lt;p&gt;So if you're &lt;em&gt;not&lt;/em&gt; interested in the code and just want to use it then please feel free to download it from the link above.&lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=96fDDI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=96fDDI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=SI2b3I"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=SI2b3I" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/323167387" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/5833783130620435871/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=5833783130620435871" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/5833783130620435871?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/5833783130620435871?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/323167387/windows-live-writer-delicious-plug-inan.html" title="Windows Live Writer del.icio.us Plug-In...an update" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/06/windows-live-writer-delicious-plug-inan.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMHQH47fip7ImA9WxdXFEs.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-8842717097573202268</id><published>2008-06-25T15:18:00.001+01:00</published><updated>2008-06-26T09:03:51.006+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-26T09:03:51.006+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><title>WPF - Settings Dialog... the Movie</title><content type="html">&lt;p&gt;&lt;em&gt;WARNING: This is an experiment! &lt;/em&gt;I thought it might be interesting (and fun) to record a brief screencast (&amp;lt;10 minutes) showing how to do the settings element of my &lt;a href="http://compilewith.net/2008/06/wpf-send-to-flickr-settings-dialogs-and.html"&gt;previous post&lt;/a&gt;, and this is the result:&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:39e332fa-c717-4ba8-b16f-084b064373f3" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div&gt;&lt;embed src="http://images.video.msn.com/flash/soapbox1_1.swf" quality="high" width="432" height="364" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://macromedia.com/go/getflashplayer" flashvars="c=v&amp;v=d5b9956c-7ec2-4684-8bf1-d0340546d5df&amp;from=writer"&gt;&lt;/embed&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;I tried both &lt;a href="http://www.youtube.com/"&gt;YouTube&lt;/a&gt; and &lt;a href="http://video.msn.com/"&gt;MSN Video&lt;/a&gt; to host this video and as you can probably see I've ended up with the latter. While YouTube uploaded the file faster it consistently failed to process it, with the upshot being that I could not view my video. MSN Video, however, accepted the file, gave me great feedback while it was uploading and then processing (whatever &lt;em&gt;processing &lt;/em&gt;means!); but it did take nearly an hour for the entire cycle to complete. Which is a whole bunch longer than it took to produce the content in the first place. I'm not sure what I expected but it was not that.&lt;/p&gt; &lt;p&gt;I'm also not overly impressed with the quality of the end result; I'm sure there is more I can do my end, at the expense of a larger file, to improve that however.&lt;/p&gt; &lt;p&gt;To that end I'm making the raw WMV file available for download, purely because of the sub optimal quality and I think it might be frustrating to watch and code along with in the current form factor:&lt;/p&gt; &lt;center&gt;&lt;a href="http://code.compilewith.net/compilewith.net.settingsexample.wmv" target="_blank"&gt;WPF Setting Example... the Movie&lt;/a&gt;&lt;/center&gt; &lt;p&gt;Please let me know what you think - if you like, I'll do more; this really is my first time at doing something of this nature so only your feedback can make it better (or go away :). Enjoy!&lt;/p&gt; &lt;p&gt;&lt;em&gt;Update:&lt;/em&gt; Here's the code (albeit cleaned up a little) created during the video, as requested:&lt;/p&gt; &lt;center&gt;&lt;a href="http://www.box.net/shared/88pmo4lgkc" target="_blank"&gt;WPF Settings Example Code&lt;/a&gt;&lt;/center&gt; &lt;center&gt;&amp;nbsp;&lt;/center&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fcompilewith.net%2f2008%2f06%2fwpf-settings-dialog-movie.html"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fcompilewith.net%2f2008%2f06%2fwpf-settings-dialog-movie.html" border="0"&gt;&lt;/a&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=hMJcmI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=hMJcmI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=NGLzvI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=NGLzvI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/319744518" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/8842717097573202268/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=8842717097573202268" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/8842717097573202268?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/8842717097573202268?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/319744518/wpf-settings-dialog-movie.html" title="WPF - Settings Dialog... the Movie" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://compilewith.net/2008/06/wpf-settings-dialog-movie.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEESXk4cSp7ImA9WxdXFEs.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-136784068210597952</id><published>2008-06-23T12:12:00.001+01:00</published><updated>2008-06-26T09:06:48.739+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-26T09:06:48.739+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><category scheme="http://www.blogger.com/atom/ns#" term="Security" /><title>WPF - Send to Flickr, Settings Dialogs and Security</title><content type="html">&lt;p&gt;There are literally &lt;a href="http://www.flickr.com/tools"&gt;hundreds of tools&lt;/a&gt; for sending your image files to your &lt;a href="http://www.flickr.com/"&gt;Flickr&lt;/a&gt; account. This post is not really about sending images to Flickr, it's not even about sending e-mails from .NET code by using &lt;a href="http://gmail.com"&gt;GMail&lt;/a&gt; as an SMTP server (I chose that approach over &lt;em&gt;mastering&lt;/em&gt; the vast Flickr API - or using a .NET wrapper of some description, &lt;a href="http://www.codeplex.com/FlickrNet"&gt;however here is a good one if you're interested&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;What I really want to explore with this post and the sample application are two things:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;How to create a settings window the WPF way, e.g. by using data binding to the &lt;em&gt;Settings&lt;/em&gt; class and successfully handling the &lt;em&gt;Cancel&lt;/em&gt; scenario, and  &lt;li&gt;Storing secrets, like your GMail password, in plain sight e.g. by using a settings configuration file, also this must be in a WPF friendly way.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Given &lt;a href="http://compilewith.net/2008/06/flickr-and-nostalgia-woes.html"&gt;my previous experience with tools that help me with my Flickr account&lt;/a&gt;, and &lt;a href="http://compilewith.net/2008/06/windows-live-writer-plug-ins-wpf-code.html"&gt;my simple requirements&lt;/a&gt;, I'm sure you'll forgive me for writing my own Flickr uploader, which forms the basis for the sample application. &lt;/p&gt; &lt;p&gt;Simply, the WPF application has three very basic windows:&lt;/p&gt; &lt;p&gt;&lt;img height="290" alt="SENTTOFLICKRSCREENSHOOTS.JPG" src="http://static.flickr.com/3209/2602991889_07e5bb591d.jpg" width="440" border="0"&gt;&lt;/p&gt; &lt;p&gt;The &lt;em&gt;Help&lt;/em&gt; window, the &lt;em&gt;Configuration&lt;/em&gt; window and the &lt;em&gt;Sending&lt;/em&gt; window. The &lt;em&gt;Help&lt;/em&gt; window is simply a &lt;em&gt;FlowDocumentViewer&lt;/em&gt; with an inline &lt;em&gt;FlowDocument&lt;/em&gt;. &lt;img style="margin: 15px 0px 0px" height="224" alt="SENTTOFLICKRMENU.JPG" src="http://static.flickr.com/3288/2603023577_a42bab50bb_m.jpg" width="200" align="right" border="0"&gt;The &lt;em&gt;Sending&lt;/em&gt; window is the one that sends an email by using the settings information. Finally, the &lt;em&gt;Settings&lt;/em&gt; window for capturing the necessary settings information.&lt;/p&gt; &lt;p&gt;The application works by you placing a shortcut to the assembly in your &lt;em&gt;Send To&lt;/em&gt; folder (the path on Vista will be:&lt;br&gt;&lt;em&gt;&lt;font size="1"&gt;%APPDATA%\Microsoft\Windows\SendTo&lt;/font&gt;&lt;/em&gt;), right-click the target image, and then click &lt;em&gt;Send to Flickr&lt;/em&gt; (or whatever you called your shortcut)&lt;em&gt;.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Providing you've populated your settings information, that process will send an email to your Flickr account with the selected image as an attachment.&lt;/p&gt; &lt;h5&gt;Data Binding to Settings&lt;/h5&gt; &lt;center&gt;&lt;a title="DATABINDINGTOSETTINGS.JPG" href="http://farm4.static.flickr.com/3051/2603788480_53743c797f_o.jpg"&gt;&lt;img height="271" alt="DATABINDINGTOSETTINGS.JPG" src="http://static.flickr.com/3051/2603788480_195e8dbc27.jpg" width="400" border="0"&gt;&lt;/a&gt;&lt;/center&gt; &lt;p&gt;The diagram above provides a visual explanation of how the settings works for this application (&lt;em&gt;click the image to see a larger version&lt;/em&gt;). The goal with this design is to only use WPF data binding, in order to remove any of the tedious &lt;em&gt;right-hand/left-hand&lt;/em&gt; code; this type of code, as described by &lt;a href="http://www.hanselman.com/"&gt;Scott Hanselman&lt;/a&gt;, is:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;[the code] where you've got an object on the left and some other object/bag/pileOdata on the right and you spend a lot of lines just going "left side = right side, left side = right side."&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Basically property field mapping; really boring, time consuming and error prone code. This design makes all that go away.&lt;/p&gt; &lt;p&gt;However, the usual downside with this approach is something I like to call "The &lt;em&gt;Cancel&lt;/em&gt; Problem". This is where the user has updated a value in the dialog, but then changes their mind and clicks the &lt;em&gt;Cancel&lt;/em&gt; button. The behaviour you want is to ignore the update, but because your UI and the backing store are bound together updates are dynamic. This means when the user tabs off the control, or presses ENTER, an update is immediately sent to the underlying data store. &lt;/p&gt; &lt;p&gt;Solutions to this problem tend to involve using intermediate objects to remember the old settings or store the new, and then when the user saves you write some left-hand/right-hand code to persist the values, booooh!&lt;/p&gt; &lt;p&gt;The simple solution I have chosen for this problem is shown in the diagram; basically in the OK button click you call &lt;em&gt;Save&lt;/em&gt; on the &lt;em&gt;Settings&lt;/em&gt; class, and on a &lt;em&gt;Cancel&lt;/em&gt; button click you call &lt;em&gt;Reload&lt;/em&gt;. This appears to be a little known technique, but solves the &lt;em&gt;Cancel&lt;/em&gt; problem completely and removes any need for intermediate objects, and therefore any &lt;em&gt;right-hand/left-hand &lt;/em&gt;code, yay! The &lt;em&gt;Reload&lt;/em&gt; method simply reads the values again from the backing store, in effect cancelling the operation, and due to the data binding update the in memory view of all the values too.&lt;/p&gt; &lt;p&gt;Next we tackle the more prickly problem of storing sensitive information in your configuration files.&lt;/p&gt; &lt;h5&gt;Storing Secrets&lt;/h5&gt; &lt;p&gt;With the myriad of tools out there to help you with &lt;em&gt;this social service&lt;/em&gt; and &lt;em&gt;the other&lt;/em&gt; &lt;em&gt;social service&lt;/em&gt;, be it: &lt;a href="http://www.flickr.com/"&gt;Flickr&lt;/a&gt;, &lt;a href="http://www.facebook.com/"&gt;FaceBook&lt;/a&gt;, &lt;a href="http://del.icio.us/"&gt;del.icio.us&lt;/a&gt; or what-have-you, all asking for your password and potentially a mountain of other personal or sensitive information, all to do things on your behalf making your life easier - what confidence do you have:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;A&lt;/strong&gt;) assuming that you trust the installed software not to do anything naughty, and  &lt;li&gt;&lt;strong&gt;B&lt;/strong&gt;) that the developers involved were security conscious &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;that your secrets will not be easily discoverable by third parties by simply spelunking through the plain text files on your machine?&lt;/p&gt; &lt;p&gt;Here's an experiment: &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Go to your favourite command line tool (mine's PowerShell), navigate to your AppData folder, in Vista that's: &lt;font face="Consolas"&gt;&amp;lt;drive&amp;gt;:\Users\YOU\AppData&lt;/font&gt;, and then type:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;Get-ChildItem -r * | Select-String [your password]&lt;/font&gt;&lt;br&gt;&lt;font size="1"&gt;(or the equivalent for your command line tool)&lt;/font&gt; &lt;/p&gt; &lt;p&gt;Then do the same for &lt;font face="Consolas"&gt;&amp;lt;drive&amp;gt;:\Program Files&lt;/font&gt; and &lt;font face="Consolas"&gt;&amp;lt;drive&amp;gt;:\Windows&lt;/font&gt;, and then, finally, search the registry for the same information. &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The question I have for you is: &lt;strong&gt;How confident are you that you won't find any instances of your password?&lt;/strong&gt; &lt;/p&gt; &lt;p&gt;I'm not saying that you will come up with anything, but what I am asking you is how &lt;em&gt;confident&lt;/em&gt; do you feel that you &lt;em&gt;won't&lt;/em&gt;, on a scale of 1 to 10 - I bet it's not 10!&lt;/p&gt; &lt;p&gt;With this sample application I wanted to explore a good way to store your email password in the &lt;em&gt;Settings&lt;/em&gt; plain-text XML file, which was also a good fit for WPF applications, whilst not adding to your potential security woes.&lt;/p&gt; &lt;p&gt;My search was a pretty short one to find the answer I needed: &lt;strong&gt;Data Protection API&lt;/strong&gt;, provided natively by Windows. &lt;a href="http://www.pluralsight.com/blogs/keith/"&gt;Keith Brown&lt;/a&gt; explains &lt;a href="http://www.pluralsight.com/wiki/default.aspx/Keith.GuideBook/HowToStoreSecretsOnAMachine.html"&gt;this all very well&lt;/a&gt; in his free book &lt;a href="http://www.pluralsight.com/wiki/default.aspx/Keith.GuideBook.HomePage"&gt;The .NET Developer's Guide to Windows Security&lt;/a&gt;. What it boils down to for this application is the use of the &lt;a href="http://msdn.microsoft.com/system.security.cryptography.protecteddata.aspx"&gt;ProtectedData&lt;/a&gt; class, provided by the .NET Framework since version 2.0, which simply has two methods: &lt;em&gt;Protect&lt;/em&gt; and &lt;em&gt;Unprotect&lt;/em&gt;. To protect a value you would write code like:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;byte[] buffer = Encoding.UTF8.GetBytes(targetValue);&lt;br&gt;byte[] encryptedData = &lt;font color="#ff8000"&gt;ProtectedData.Protect&lt;/font&gt;(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; buffer, &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.entropy, &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataProtectionScope.CurrentUser);&lt;/font&gt;  &lt;p&gt;To make this all WPF friendly I wrapped the &lt;em&gt;ProtectedData&lt;/em&gt; calls into value converter - so when data binding you can store and retrieve secure information by using my &lt;em&gt;ProtectedDataConverter&lt;/em&gt; class as the &lt;em&gt;Converter&lt;/em&gt; on the binding. &lt;/p&gt; &lt;p&gt;For passwords where you want to use the WPF &lt;em&gt;PasswordBox&lt;/em&gt; control however, you cannot data bind to the &lt;em&gt;Password&lt;/em&gt; property, it's not a dependency property - for obvious security reasons, therefore in this application I create an instance of the converter in code and use it that way:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;this.PasswordBox.Password = DataCoverter.Convert(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff8000"&gt;Settings.Default.Password&lt;/font&gt;, &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeof(string), &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null, &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CultureInfo.CurrentUICulture) as string;&lt;/font&gt;  &lt;p&gt;To convert the string value back to plain text (decrypt) is shown above, and to convert back in to a secure value (encrypt):&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&lt;font color="#ff8000"&gt;Settings.Default.Password&lt;/font&gt; = DataCoverter.ConvertBack(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.PasswordBox.Password,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeof(string),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; null,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CultureInfo.CurrentUICulture) as string;&lt;/font&gt;  &lt;p&gt;The converter returns the cipher text in a Base64 encoded string for easy plain-text storage. &lt;/p&gt; &lt;h5&gt;Conclusion&lt;/h5&gt; &lt;p&gt;I think I achieved my goals with this software; you, dear Reader, are the real judge of my assertion; to that end the code available for your review and use:&lt;/p&gt; &lt;center&gt;&lt;a href="http://www.box.net/shared/kw40xgg84g"&gt;PaulJ.Windows.SendToFlickr&lt;/a&gt;&lt;/center&gt; &lt;p&gt;Obviously if you have an problems with the code then let me know. Your comments and personal conclusions are also very much welcome. I would love to know where you use this code, or indeed any of the code I publish, so all I ask is if you intend to use the code please drop me a line to let me know.&lt;/p&gt; &lt;p&gt;Enjoy! &lt;/p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fcompilewith.net%2f2008%2f06%2fwpf-send-to-flickr-settings-dialogs-and.html"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fcompilewith.net%2f2008%2f06%2fwpf-send-to-flickr-settings-dialogs-and.html" border="0"&gt;&lt;/a&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=NAh3jI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=NAh3jI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=tiJHTI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=tiJHTI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/318037936" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/136784068210597952/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=136784068210597952" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/136784068210597952?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/136784068210597952?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/318037936/wpf-send-to-flickr-settings-dialogs-and.html" title="WPF - Send to Flickr, Settings Dialogs and Security" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/06/wpf-send-to-flickr-settings-dialogs-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEANSH8zfip7ImA9WxdQGUk.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-4853907072257748439</id><published>2008-06-20T08:22:00.001+01:00</published><updated>2008-06-20T08:26:39.186+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-20T08:26:39.186+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="News" /><title>Tufte complete... Book4</title><content type="html">&lt;p&gt;I've finished all the books now, &lt;a href="http://www.edwardtufte.com/tufte/books_vdqi"&gt;this one&lt;/a&gt; was easily as good as his &lt;a href="http://www.edwardtufte.com/tufte/books_be"&gt;later books&lt;/a&gt;. &lt;em&gt;The Visual Display of &lt;img alt="TufteBook1" src="http://static.flickr.com/3038/2570178302_a83dcc5a52_m.jpg" align="right" border="0"&gt;Quantitative Information&lt;/em&gt; offers practical advice and clear examples; I can see how this was the springboard for his later works.&lt;/p&gt; &lt;p&gt;I'm going to end this Tufte series with a quote from the book shown on the right; here Tufte is talking about designs for the display of information, but I think it equally applies well to software development and design:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;What is to be sought in the designs for the display of information is the clear portrayal of complexity. Not the complication of the simple; rather the task of the designer is to give visual access to the subtle and the difficult - that is,&lt;/p&gt; &lt;center&gt; &lt;p&gt;the revelation of the complex.&lt;/p&gt;&lt;/center&gt;&lt;/blockquote&gt; &lt;p&gt;Personally, I think all software development and design boils down to the management of complexity, at some level or other. What I see in Tufte's words is simply: &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Manage complexity; avoid making the simple complex.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The second part is always tricky - especially when designing at the keyboard. Turning a simple solution into a complex implementation is obviously undesirable (albeit quite common), to learn that the same is true for information design is not that surprising I guess, and it probably holds true for many other technical fields as well, I'm sure.&lt;/p&gt; &lt;p&gt;I am a little sad that I have finished this series and I will continue to blog about Tufte occasionally and I will also continue to follow his work. I do feel that I've savoured, enjoyed and poured over each book, but I cannot hear soon enough that there is another book coming from Graphics Press on information design. &lt;/p&gt; &lt;center&gt;&lt;a title="TufteBook1" href="http://www.edwardtufte.com/tufte/books_vdqi"&gt;&lt;img height="71" alt="vdqi" src="http://static.flickr.com/3038/2570178302_a83dcc5a52_t.jpg" width="112" border="0"&gt;&lt;/a&gt;&lt;a title="TufteBook3" href="http://www.edwardtufte.com/tufte/books_ei"&gt;&lt;img height="71" alt="ei" src="http://static.flickr.com/3055/2570171046_367b87df42_t.jpg" width="112" border="0"&gt;&lt;/a&gt;&lt;br&gt;&lt;a title="TufteBook" href="http://www.edwardtufte.com/tufte/books_visex"&gt;&lt;img height="71" alt="ve" src="http://static.flickr.com/3020/2570171000_a8b9996a4b_t.jpg" width="112" border="0"&gt;&lt;/a&gt;&lt;a title="TufteBook2" href="http://www.edwardtufte.com/tufte/books_be"&gt;&lt;img height="71" alt="be" src="http://static.flickr.com/3093/2569345417_a3685e2368_t.jpg" width="112" border="0"&gt;&lt;/a&gt;&lt;/center&gt; &lt;p&gt;Finally, my greatest hope is that you've been inspired to take a look at this fascinating field yourself - I would love to hear about your adventures with information design and Tufte, what you have done or plan to do, please drop me a line and share the wealth.&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=wJZfoI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=wJZfoI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=q0Ao3I"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=q0Ao3I" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/316026794" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/4853907072257748439/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=4853907072257748439" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/4853907072257748439?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/4853907072257748439?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/316026794/tufte-complete-book4.html" title="Tufte complete... Book4" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/06/tufte-complete-book4.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQBRn4-cCp7ImA9WxdQGEw.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-7426122321856822229</id><published>2008-06-18T17:54:00.001+01:00</published><updated>2008-06-18T19:39:17.058+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-18T19:39:17.058+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><title>WPF - The Zoom Decorator: Part 3</title><content type="html">&lt;p&gt;Despite what the title says, this post is not about &lt;em&gt;Decorator&lt;/em&gt;s in WPF, the &lt;a href="http://compilewith.net/2008/06/wpf-zoom-decorator-part-2.html"&gt;previous post&lt;/a&gt; in this series explains why decorators are not on the menu; the &lt;a href="http://compilewith.net/2008/06/wpf-zoom-decorator-part1.html"&gt;post&lt;/a&gt; before that gives the background to what we're going to delve into in this post.&lt;/p&gt; &lt;p&gt;Now that's out the way, on the with the show. In this post we're going to take the &lt;a href="http://code.compilewith.net/zoom.xaml"&gt;simple XAML we defined for zooming&lt;/a&gt; and turn that into a reusable Zoom control.&lt;/p&gt; &lt;h5&gt;Migrating Loose XAML into a Control&lt;/h5&gt; &lt;p&gt;Our first step is to migrate the loose XAML into a control, first lets define a class called &lt;em&gt;Zoom&lt;/em&gt; that inherits from &lt;em&gt;ContentControl&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;namespace PaulJ.Windows.Controls&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; using System.Windows.Controls;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Zoom : ContentControl&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static Zoom()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DefaultStyleKeyProperty.OverrideMetadata(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeof(Zoom), &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new FrameworkPropertyMetadata(typeof(Zoom)));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;  &lt;p&gt;The interesting part here is in the code for the static constructor; note that it overrides the metadata property for the controls &lt;em&gt;DefaultStyle&lt;/em&gt;. What this says is that our new control's type is the resource key for it's style. What this enables us to do is define a style for our control without having to provide a resource key name for it, we can just specify the type - like you would for a &lt;em&gt;Button&lt;/em&gt; or a &lt;em&gt;TextBox&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;For example, the following would replace the style for a &lt;em&gt;Button&lt;/em&gt;:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;Style TargetType="{x:Type &lt;font color="#ff8000"&gt;Button&lt;/font&gt;}"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Setter Property="Template"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Setter.Value&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ControlTemplate TargetType="{x:Type &lt;font color="#ff8000"&gt;Button&lt;/font&gt;}"&amp;gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;em&gt;&amp;lt;!-- Control Template XAML --&amp;gt;&lt;/em&gt; &lt;/font&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ControlTemplate&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Setter.Value&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Setter&amp;gt;&lt;br&gt;&amp;lt;/Style&amp;gt;&lt;/font&gt;  &lt;p&gt;Whatever you specify for the content of the control template will be how the button looks; as an &lt;em&gt;x:Key&lt;/em&gt; value has not been specified the &lt;em&gt;Type&lt;/em&gt; value will be used as the key - this will effectively change &lt;em&gt;all&lt;/em&gt; buttons in scope. If we specify an &lt;em&gt;x:Key&lt;/em&gt; value then only the &lt;em&gt;Button&lt;/em&gt;s that specify a &lt;em&gt;Style&lt;/em&gt; property bound to that key would show the content specified in the new control template.&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;Button /&amp;gt;&lt;/font&gt; &lt;font color="#008000"&gt;&amp;lt;!-- Good --&amp;gt;&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&amp;lt;Button Style="{StaticResource myButtonStyle}" /&amp;gt; &lt;font color="#ff0000"&gt;&amp;lt;!-- Bad --&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;If we did not override the metadata in the static constructor for our control, we would have to use the syntax shown for the second button in all the places we want to use our control; which would be a little tedious and would not give the same experience as using the built in controls.&lt;/p&gt; &lt;p&gt;So now we have a resource key defined and we know what we want our control to look like (the loose XAML already written), the question now is: where to put it, where do we specify the &lt;em&gt;default&lt;/em&gt; style for our control? There are two things that we need to do to provide our a &lt;em&gt;Default&lt;/em&gt; style: First, add attribute to our assembly and second, add a generic resource dictionary.&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;[assembly: ThemeInfo(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ResourceDictionaryLocation.None, &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ResourceDictionaryLocation.SourceAssembly)]&lt;/font&gt;  &lt;p&gt;The &lt;em&gt;ThemeInfoAttribute&lt;/em&gt; class is an assembly level attribute, and in the example above we are saying that we have no &lt;strong&gt;theme&lt;/strong&gt; level specific resources (we're not replacing Aero or Luna here!) and we have a &lt;strong&gt;generic&lt;/strong&gt; dictionary located within the source assembly i.e. our control assembly.&lt;/p&gt; &lt;p&gt;With this code in place, WPF is now going to look for a resource dictionary in the following location at run time:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;pack://application:,,,/Themes/Generic.xaml&lt;/font&gt;&lt;/p&gt; &lt;p&gt;That resource dictionary is as close to &lt;em&gt;System Scope&lt;/em&gt; as we can get with our assembly; without defining any new themes (something you will probably &lt;em&gt;never&lt;/em&gt; do, unless you're writing an operating system or intend to replace Aero!).&lt;/p&gt; &lt;p&gt;With that file in place, we now have somewhere to dump our controls XAML. We only need to make a couple of minor adjustments to migrate the loose XAML in to a control template, I've highlighted some of important the changes:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;Style TargetType="{x:Type &lt;font color="#ff8000"&gt;local:Zoom&lt;/font&gt;}"&amp;gt;&lt;br&gt;&amp;lt;Setter Property="Template"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Setter.Value&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ControlTemplate TargetType="{x:Type &lt;font color="#ff8000"&gt;local:Zoom&lt;/font&gt;}"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid Height="&lt;font color="#ff8000"&gt;{TemplateBinding Height}&lt;/font&gt;"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Width="&lt;font color="#ff8000"&gt;{TemplateBinding Width}&lt;/font&gt;"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Border ...&amp;gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ContentControl ClipToBounds="True"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ContentPresenter ...&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ContentPresenter.RenderTransform&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ScaleTransform ScaleX="{Binding Path=Value, &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElementName=&lt;font color="#ff8000"&gt;PART_ZoomSlider&lt;/font&gt;}" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScaleY="{Binding Path=Value, &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElementName=&lt;font color="#ff8000"&gt;PART_ZoomSlider&lt;/font&gt;}"/&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/font&gt;&amp;nbsp;&lt;font face="Consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font face="Consolas"&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Slider x:Name="&lt;font color="#ff8000"&gt;PART_ZoomSlider&lt;/font&gt;" ... /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/font&gt;&lt;br&gt;&lt;font face="Consolas"&gt;&amp;lt;/Style&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;The key changes are the &lt;em&gt;TargetType&lt;/em&gt; association to our control, the use of &lt;em&gt;TemplateBinding&lt;/em&gt; rather than fixed values, meaning the values will be obtained at run time from the templated parent (which will be an instance of our control). Finally, I renamed the slider so that it uses a standard naming convention for template parts; other than that the template remains pretty much unchanged.&lt;/p&gt; &lt;p&gt;We now have a working control identical to the loose XAML version in functionality, but it can now be used like this:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;Page x:Class="PaulJ.Windows.MainPage"&lt;br&gt;&amp;nbsp;&amp;nbsp; xmlns=..."&lt;br&gt;&amp;nbsp;&amp;nbsp; xmlns:x="..."&lt;br&gt;&amp;nbsp;&amp;nbsp; &lt;font color="#ff8000"&gt;xmlns:z="clr-namespace:PaulJ.Windows.Controls;assembly=..."&lt;/font&gt;&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Grid&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;img alt="OrangeZoom.JPG" src="http://static.flickr.com/3133/2590559002_2d324c1f89.jpg" align="right" border="0"&gt;&lt;font color="#ff8000"&gt;&amp;lt;z:Zoom&amp;gt;&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Height="150" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Width="150" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fill="Orange" /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff8000"&gt;&amp;lt;/z:Zoom&amp;gt;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Grid&amp;gt;&lt;br&gt;&amp;lt;/Page&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;h5&gt;Fixing the ClipToBounds&lt;/h5&gt; &lt;p&gt;There is a small problem with our current implementation: when we zoom to full-size we loose the border; the image below demonstrates:&lt;/p&gt; &lt;center&gt;&lt;img alt="ZoomMissingBorder.jpg" src="http://static.flickr.com/3171/2589723423_d0abfd200b.jpg" border="0"&gt;&lt;/center&gt; &lt;p&gt;This is because the &lt;em&gt;ClipToBounds&lt;/em&gt; property is applied to the &lt;em&gt;Border&lt;/em&gt;, so while the contained element (a rectangle in this example) does not leak outside the bounds of the &lt;em&gt;Border&lt;/em&gt; control, there is no room left for the control to draw the border lines. The simplest way to fix that is to introduce a child control to the &lt;em&gt;Border&lt;/em&gt; that acts as the clipping container:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;Border BorderBrush="{TemplateBinding BorderBrush}" &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BorderThickness="{TemplateBinding BorderThickness}"&amp;gt;&lt;br&gt;&amp;nbsp; &lt;font color="#ff8000"&gt;&amp;lt;ContentControl ClipToBounds="True"&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;img style="margin: 0px 0px 10px 5px" height="100" alt="ZoomBorderFixed.JPG" src="http://static.flickr.com/3290/2589734019_6c1b299da9.jpg" width="100" align="right" border="0"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ContentPresenter ... /&amp;gt;&lt;br&gt;&amp;nbsp; &lt;font color="#ff8000"&gt;&amp;lt;/ContentControl&amp;gt;&lt;/font&gt;&lt;br&gt;&amp;lt;/Border&amp;gt;&lt;/font&gt;  &lt;p&gt;I used a &lt;em&gt;ContentControl&lt;/em&gt; for this purpose as it does not have any visual appearance of it's own, meaning it's lightweight, but it does participate in layout of the visual tree - so it is perfect for our needs. No more &lt;em&gt;Border&lt;/em&gt; issues.&lt;/p&gt; &lt;h5&gt;Adding some Knobs and Dials&lt;/h5&gt; &lt;p&gt;Currently all the slider behaviour is static, you'd have to completely replace the template just to make the zoom go from 0 to 500 percent (the default is 200 percent), or to start at 25 percent instead of a hundred. You also would be unable to change any of these values for an animation effect or in even in code without jumping through lots of hoops.&lt;/p&gt; &lt;p&gt;So lets expose three core properties &lt;em&gt;Value&lt;/em&gt;, &lt;em&gt;Minimum&lt;/em&gt; and &lt;em&gt;Maximum&lt;/em&gt;; after we've done that you'll easily see how you could add more flexibility to your version of the control.&lt;/p&gt; &lt;p&gt;The process is pretty straight forward: define a &lt;em&gt;Dependency Property&lt;/em&gt; for each value we wish to represent, and then update the control template to use a &lt;em&gt;TemplateBinding&lt;/em&gt; for that value:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Value", &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeof(double), &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; typeof(Zoom), &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new UIPropertyMetadata(1.0));&lt;/font&gt;  &lt;p&gt;This creates a Dependency property to represent the &lt;em&gt;Value&lt;/em&gt; of the &lt;em&gt;Zoom&lt;/em&gt; control, and then we expose the dependency property value by using a standard .NET property:  &lt;p&gt;&lt;font face="Consolas"&gt;[Bindable(true), Category("Behavior")]&lt;br&gt;public double Value&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return (double)GetValue(ValueProperty); }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { SetValue(ValueProperty, value); }&lt;br&gt;}&lt;/font&gt;  &lt;p&gt;By doing with we make the dependency property accessible both from code and from XAML. Note that I've also added a couple of attributes to the property so that it is located sensibly in the property window of any UI designers, such as Expression Blend or Visual Studio, and I've also said that the value can be safely used for data binding.  &lt;p&gt;You just repeat that process for the other properties and then we're done. The following link is WPF Browser Application (XBAP) that uses the new &lt;em&gt;Zoom&lt;/em&gt; control's various different properties:  &lt;p&gt; &lt;center&gt;&lt;a href="http://code.compilewith.net/xbaps/zoom/PaulJ.Windows.ZoomApplication.xbap"&gt;PaulJ.Windows.ZoomApplication.xbap&lt;/a&gt;&amp;nbsp;&lt;/center&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;I'm also making all the source code available for you to do with as you wish. All that I ask is that if you do anything cool with it then please send me a link or an email:&lt;/p&gt; &lt;p&gt; &lt;center&gt;&lt;a href="http://www.box.net/shared/faqw98h8ow"&gt;Download the Source&lt;/a&gt;&lt;/center&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;There are various improvements that could be made, such as adding animation to the zooming effect or adding the ability to move the zoom slider into different positions within the control. Also feel free to make these changes and then drop me a line. &lt;/p&gt; &lt;p&gt;Obviously if you find any bugs or have any problems with the code then please let me know. &lt;/p&gt; &lt;p&gt;Enjoy!&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=nzsrII"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=nzsrII" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=JAx5BI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=JAx5BI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/314753583" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/7426122321856822229/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=7426122321856822229" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/7426122321856822229?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/7426122321856822229?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/314753583/wpf-zoom-decorator-part-3.html" title="WPF - The Zoom Decorator: Part 3" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/06/wpf-zoom-decorator-part-3.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMHR3k6eyp7ImA9WxdQF0o.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-5005767529135770747</id><published>2008-06-17T17:08:00.001+01:00</published><updated>2008-06-18T09:07:16.713+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-18T09:07:16.713+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WPF" /><category scheme="http://www.blogger.com/atom/ns#" term="Architecture" /><category scheme="http://www.blogger.com/atom/ns#" term=".Net" /><title>Windows Live Writer, Plug-Ins, WPF, Code Analysis and Tufte!</title><content type="html">&lt;p&gt;After the &lt;a href="http://compilewith.net/2008/06/flickr-and-nostalgia-woes.html"&gt;other days debacle with Nostalgia and Flickr&lt;/a&gt; I looked to simplify my picture posting process for this blog. My requirements are simple: &lt;em&gt;something like&lt;/em&gt; right-click an image, and then click "&lt;em&gt;Send to Flickr&lt;/em&gt;" or something similar. I figured that someone &lt;em&gt;must&lt;/em&gt; have written this already.... but no, I came up dry. &lt;/p&gt; &lt;p&gt;&lt;img style="margin: 0px 0px 10px 15px" src="http://l.yimg.com/g/images/flickr_logo_gamma.gif.v35314.14" align="right"&gt; I figured I'd have to write my own version against the &lt;a href="http://www.flickr.com/"&gt;Flickr&lt;/a&gt; APIs (which are vast!). However, during my initial investigations I found out two interesting things:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;You can post images to Flickr via email, and  &lt;li&gt;There is a &lt;a href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt; plug-in for Flickr images (&lt;em&gt;&lt;font size="1"&gt;WLW is the text editor that I use to write all my posts&lt;/font&gt;&lt;/em&gt;).&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Armed with this information, I managed to completely streamline my image uploading process with zero code on my part! Good enough... for now. &lt;/p&gt; &lt;p&gt;&lt;img style="margin: 0px 0px 15px 15px" src="http://images.del.icio.us/static/img/delicious.42px.gif" align="right"&gt; With that, I &lt;a href="http://del.icio.us/compilewith.net"&gt;del.icio.us&lt;/a&gt;'d the appropriate links and figured that I would blog about my experience, share the solution, with you dear Reader, and seek your opinion on the matter. Then it occurred to me that there &lt;em&gt;must&lt;/em&gt; be a Windows Live Writer plug-in for del.icio.us... my search began anew. But, again, I came up dry (well, I found &lt;em&gt;one,&lt;/em&gt; but it really sucked).&lt;/p&gt; &lt;p&gt;By this time my interest was really piqued with regards to Windows Live Writer plug-ins; I wondered what it would take to write a plug-in with my exacting requirements:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;It must be a WPF front-end (nothing else will do)  &lt;li&gt;It must use XLinq for the back-end (experiment)  &lt;li&gt;It must be &lt;a href="http://msdn.microsoft.com/en-us/library/bb429476(VS.80).aspx"&gt;FxCop&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/sourceanalysis/"&gt;Microsoft Source Analysis&lt;/a&gt; compliant (as I want to ship it, to you dear Reader)  &lt;li&gt;The UI should "suck-less" and follow as many Tufte principals as makes sense for an application of this type (experiment)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a title="WLWDPI.jpg" href="http://farm4.static.flickr.com/3062/2587529346_b6cee2e439_o.jpg" target=""&gt;&lt;img style="margin: 0px 15px 0px 0px" height="101" alt="WLWDPI.jpg" src="http://static.flickr.com/3062/2587529346_a4a4e57812_t.jpg" width="112" align="left" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;When I started out on this adventure I was far from sure if the WPF approach was even possible; Windows Live Writer is a Windows Forms based application, therefore the plug-ins &lt;strong&gt;must&lt;/strong&gt; also be WinForms. However, you can load WPF controls into WinForms using some fancy interop, so I was confident I could make &lt;em&gt;something&lt;/em&gt; work. But, what I really wondered was:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Is it possible to load a WPF Window from WinForms? &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;I wanted to write something like:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;private void buttonOpenDialog_Click(object sender, EventArgs e)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff8040"&gt;MyWpfWindow dialog = new MyWpfWindow();&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;font color="#ff8040"&gt;dialog.ShowDialog()&lt;/font&gt; == true)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show(&lt;font color="#ff8040"&gt;dialog.SomeVlaue&lt;/font&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;  &lt;p&gt;Where the &lt;strong&gt;buttonOpenDialog&lt;/strong&gt; method was inside a WinForms application. It turns out that this is not only possible but it also work extremely well.&lt;/p&gt; &lt;p&gt;I wanted to use XLinq given that the data will be coming from del.icio.us, in the form of an RSS feed, and I want to filter the results locally XLinq seemed like a perfect fit, and indeed it has been:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;IEnumerable&amp;lt;LinkItem&amp;gt; result =&lt;br&gt;from i in this.xdoc.Element(rdf + "RDF").Elements(rss + "item")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select new LinkItem&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Categories = i.Element(dce + "subject").Value,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date = (DateTime)i.Element(dce + "date"),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description = i.Element(rss + "description").Value,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Link = i.Element(rss + "link").Value,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Title = i.Element(rss + "title").Value&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/font&gt;  &lt;p&gt;This is a simple query to deserialize the RSS feed into a list of custom &lt;strong&gt;LinkItem&lt;/strong&gt; class, which is then used by the WPF UI. &lt;/p&gt; &lt;p&gt;To load the RSS feed in the first instance is as simple as:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;this.xdoc = XDocument.Load(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "http://del.icio.us/rss/compilewith.net);&lt;/font&gt;&lt;/p&gt; &lt;p&gt;That forms the basis of the back-end provider.&lt;/p&gt; &lt;p&gt;Next is the static code analysis tools. The main difference between the two tools I have chosen is that FxCop reports on the assemblies (post build), whereas the Source Analysis tool does what it says on the tin, and looks at the source text files (pre build). &lt;/p&gt; &lt;p&gt;The important aspect to understand here is that I'm not looking for a &lt;em&gt;zero bounce&lt;/em&gt; with these tools. It may be possible, and indeed I did nearly achieve a zero bounce with the Source Analysis tool, I was finally thwarted due to the way WPF works. As was the case with this code, sometimes you simply cannot obey all the rules and still compile! &lt;/p&gt; &lt;p&gt;The rules are there to help you, not hand-cuff or hurt you, remember to only apply the rules that make your code better, cos aiming for 100 percent compliance in my experience means less than optimal code; not to mention the extra time required to chase down the last 1 or 2 percent of the violations, that is time better spent on shipping new features. &lt;/p&gt; &lt;p&gt;So with that in mind, here is my analysis of the remaining FxCop rules that I have no intention of fixing and why:&lt;/p&gt; &lt;p&gt;&lt;a title="FxCopAnalysis.JPG" href="http://farm4.static.flickr.com/3056/2587256954_3b6a2ae09f_o.jpg" target=""&gt;&lt;img height="259" alt="FxCopAnalysis.JPG" src="http://static.flickr.com/3056/2587256954_cbce75be9c.jpg" width="400" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Note also that there is a way to suppress the violations in your source code for FxCop (and other static code analysis tools?), using code analysis attributes and providing compile time hints, which in production code, I strongly recommend you do. That way (1) you formally acknowledge the rule violation, (2) you also explain why the rule is ignored, and (3) most importantly, you explain why as close to the code as possible. &lt;/p&gt; &lt;p&gt;(&lt;em&gt;&lt;font size="1"&gt;If anyone is interested in how to achieve the suppression of FxCop rules in this way with attributes then drop me a line an I'll knock a "how-to" post together&lt;/font&gt;&lt;/em&gt;). &lt;/p&gt; &lt;p&gt;And finally, the Tufte analysis. This is probably the most subjective part of the work I've done for this plug-in; but I honestly believe that this UI is one of the best I've done. &lt;/p&gt; &lt;p&gt;This is the bit where I would most appreciate feedback:&lt;/p&gt; &lt;p&gt;&lt;a title="TufteAnalysis.JPG" href="http://farm4.static.flickr.com/3175/2586422437_6ac7512074_o.jpg" target=""&gt;&lt;img height="260" alt="TufteAnalysis.JPG" src="http://static.flickr.com/3175/2586422437_29e5dcb7b0.jpg" width="412" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In the final analysis I'm happy with the result, the code is available in two different forms:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.box.net/shared/25no61nusk"&gt;The Source Files&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.box.net/shared/yr503zww8s"&gt;Just the Binaries&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This is the first time that I've released code in this way, so your feedback would be greatly appreciated. Enjoy!&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=IedR3I"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=IedR3I" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=MpY8GI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=MpY8GI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/313900455" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/5005767529135770747/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=5005767529135770747" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/5005767529135770747?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/5005767529135770747?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/313900455/windows-live-writer-plug-ins-wpf-code.html" title="Windows Live Writer, Plug-Ins, WPF, Code Analysis and Tufte!" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://compilewith.net/2008/06/windows-live-writer-plug-ins-wpf-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4MR306eCp7ImA9WxdQEUU.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-6104297369385006623</id><published>2008-06-11T10:46:00.001+01:00</published><updated>2008-06-11T12:49:46.310+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-11T12:49:46.310+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="News" /><category scheme="http://www.blogger.com/atom/ns#" term="Off Topic" /><title>Flickr and Nostalgia Woes</title><content type="html">&lt;p&gt;Apologies for those of you who will get some of my older posts in your feeds this morning. I've had to repost a bunch of articles with fresh image links.&lt;/p&gt; &lt;p&gt;I've been using &lt;a href="http://www.flickr.com/photos/paulja"&gt;flickr&lt;/a&gt; for almost as long as this blog as been alive, with great success, I'm a huge fan; more recently I've been using &lt;a href="http://www.thirteen23.com/work/nostalgia"&gt;Nostalgia&lt;/a&gt; from the boys a &lt;a href="http://www.thirteen23.com/"&gt;Thirteen23&lt;/a&gt;, which is where the trouble begins... I think. I don't know for sure but a bunch of pictures went AWOL yesterday after what appeared to be a successful session, and now I cannot trust the application anymore.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;img height="211" src="http://www.thirteen23.com/images/labs/nostalgia_small.jpg" width="400"&gt; &lt;/p&gt; &lt;p&gt;Which is a real shame as Nostalgia looks &lt;em&gt;great&lt;/em&gt; and is seriously &lt;em&gt;usable&lt;/em&gt;, but it is only a &lt;em&gt;proof of concept&lt;/em&gt; and it's my own fault for using it for something an important to me as my blog. Ho-hum, lesson learned.&lt;/p&gt; &lt;p&gt;Sorry for any inconvenience in your RSS feed, my bad :-(&lt;/p&gt; &lt;p&gt;&lt;em&gt;&lt;font size="1"&gt;(Note: have "touched" my newer posts so they should appear at the top of feed)&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=lhRVjI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=lhRVjI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/Compilewithnet?a=5hdSzI"&gt;&lt;img src="http://feeds.feedburner.com/~f/Compilewithnet?i=5hdSzI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Compilewithnet/~4/309505503" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://compilewith.net/feeds/6104297369385006623/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="https://www.blogger.com/comment.g?blogID=9534263&amp;postID=6104297369385006623" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/6104297369385006623?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/9534263/posts/default/6104297369385006623?v=2" /><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/Compilewithnet/~3/309505503/flickr-and-nostalgia-woes.html" title="Flickr and Nostalgia Woes" /><author><name>Paul</name><uri>http://www.blogger.com/profile/03844348801538127249</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://compilewith.net/2008/06/flickr-and-nostalgia-woes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUACRXk8fCp7ImA9WxdQEUo.&quot;"><id>tag:blogger.com,1999:blog-9534263.post-1408603878781959050</id><published>2008-06-06T11:25:00.000+01:00</published><updated>2008-06-11T10:49:24.774+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-11T10:49:24.774+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Architecture" /><title>Make my code better... please!</title><content type="html">&lt;p&gt;Having moved away from the world of software design and architecture, for my day job at least, does not mean that I have not been keeping a keen eye on the tools and technology for &lt;a href="http://msdn.microsoft.com/en-us/arcjournal/cc505970.aspx#_Architect_Role"&gt;Technical Architects&lt;/a&gt; working with .NET. This post is a round up of the &lt;a href="#_tools"&gt;tools&lt;/a&gt;, &lt;img style="margin: 15px 0px 0px 10px" src="http://farm2.static.flickr.com/1437/1210287457_bf02946bbc_m.jpg" align="right"&gt; &lt;a href="#_docs"&gt;documentation&lt;/a&gt; and &lt;a href="#_podcasts"&gt;podcasts&lt;/a&gt; that have crossed my path over the last few weeks and months in relation to code design, maintenance and architecture:&lt;/p&gt; &lt;h5&gt;&lt;a name="_tools"&gt;Tools&lt;/a&gt;&lt;/h5&gt; &lt;p&gt;While &lt;a href="http://blogs.msdn.com/fxcop/"&gt;FxCop&lt;/a&gt; does WPF and .NET 3.5 in their latest beta release, there is still some way to go with &lt;a href="http://en.wikipedia.org/wiki/Static_code_analysis"&gt;static code analysis&lt;/a&gt;; mainly because FxCop will only look at &lt;em&gt;compiled&lt;/em&gt; assemblies. This is important to note when looking a code &lt;em&gt;style&lt;/em&gt;; which is what a fair percentage of most code reviews are about. To help with tha