<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB"><title type="html">Bart</title><subtitle type="html">Software Engineer - Red Gate Software</subtitle><id>http://www.simple-talk.com/community/blogs/bart/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.simple-talk.com/community/blogs/bart/atom.aspx" /><generator uri="http://communityserver.org" version="2.0.60217.2664">Community Server</generator><updated>2010-11-30T12:28:00Z</updated><entry><title>Notes from BUILD - Day 1 - Big Picture Session 2 Part 2 - Kieran Mockford and Chris Sells on Tools for Building Metro Style Apps</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/10/10/103598.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/10/10/103598.aspx</id><published>2011-10-10T00:01:00Z</published><updated>2011-10-10T00:01:00Z</updated><content type="html">Notes from Kieran Mockford's and Chris Sells' session on tooling for Metro app development at last months //BUILD/ conference....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/10/10/103598.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=103598" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>Notes from BUILD - Day 1 - Big Picture Session 2 Part 1 - Ales Holecek on the WinRT APIs</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/10/07/103569.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/10/07/103569.aspx</id><published>2011-10-07T03:01:00Z</published><updated>2011-10-07T03:01:00Z</updated><content type="html">Notes on Aleš Holeček's session on the WinRT APIs from Day 1 of //BUILD/....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/10/07/103569.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=103569" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>Notes from BUILD - Day 1 - Big Picture Session 1 - Jensen Harris on 8 Traits of Great Metro Style Apps</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/10/06/103553.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/10/06/103553.aspx</id><published>2011-10-06T03:01:00Z</published><updated>2011-10-06T03:01:00Z</updated><content type="html">Notes on Jensen Harris' talk entitled "8 Traits of Great Metro Style Apps" on Day 1 of last month's //BUILD/ conference....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/10/06/103553.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=103553" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>Notes from BUILD - Day 1 - Keynote Part 6 - Windows 8 Professional Platform with Steven Sinofsky, and a Smidge of Cloud with Chris Jones</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/10/05/103550.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/10/05/103550.aspx</id><published>2011-10-05T03:01:00Z</published><updated>2011-10-05T03:01:00Z</updated><content type="html">Steven Sinofsky talks about the Windows 8 Professional Platform during the Day 1 Keynote at last month's BUILD conference, and I take VERY sparse notes on Chris Jones' Cloud Services presentation....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/10/05/103550.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=103550" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>Notes from BUILD - Day 1 - Keynote Part 5 - Michael Angiulo's Hardware Platform Presentation and Demos</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/10/04/103549.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/10/04/103549.aspx</id><published>2011-10-04T03:01:00Z</published><updated>2011-10-04T03:01:00Z</updated><content type="html">Notes from Michael Anguilo's Windows 8 Hardware Platform presentation and demos during the Day 1 Keynote at //BUILD/ last month....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/10/04/103549.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=103549" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>Notes from BUILD - Day 1 - Keynote Part 4 - Antoine Leblond's Windows 8 Platform and Tools Presentation - The App Store &amp;amp; Converting a Silverlight App to Metro</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/10/03/103548.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/10/03/103548.aspx</id><published>2011-10-03T03:01:00Z</published><updated>2011-10-03T03:01:00Z</updated><content type="html">More from Antoine Leblond during the Day 1 Keynote at last month's //BUILD/ conference - this time talking about the Windows App Store and migrating apps from Silverlight to Metro....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/10/03/103548.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=103548" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>Notes from BUILD - Day 1 - Keynote Part 3 - Antoine Leblond's Windows 8 Platform and Tools Presentation - Building an HTML5/JavaScript Metro App</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/09/30/103545.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/09/30/103545.aspx</id><published>2011-09-30T03:01:00Z</published><updated>2011-09-30T03:01:00Z</updated><content type="html">Transcription of notes from Antoine Leblond's Day 1 Keynote session at //BUILD/ where he demoed the creation of an HTML5 &amp; JavaScript Metro app....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/09/30/103545.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=103545" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>Notes from BUILD - Day 1 - Keynote Part 2 - Julie Larson-Green's Windows 8 Experience Demo</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/09/29/103533.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/09/29/103533.aspx</id><published>2011-09-29T03:01:00Z</published><updated>2011-09-29T03:01:00Z</updated><content type="html">Transcription of my notes from Julie Larson-Green's Windows 8 Experience presentation during the Day 1 Keynote at Microsoft's //BUILD/ conference in Anaheim, CA, earlier this month....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/09/29/103533.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=103533" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>Notes from BUILD - Day 1 - Keynote Part 1 - Steven Sinofsky's Introduction</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/09/28/103531.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/09/28/103531.aspx</id><published>2011-09-28T16:45:00Z</published><updated>2011-09-28T16:45:00Z</updated><content type="html">Transcription of my notes from Steven Sinofsky's introduction during the Day 1 Keynote at Microsoft's //BUILD/ conference in Anaheim, CA, earlier this month....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/09/28/103531.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=103531" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>.NET Reflector 7.2 Early Access Build 2 Released: Performance Critical</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/05/31/101765.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/05/31/101765.aspx</id><published>2011-05-31T14:53:22Z</published><updated>2011-05-31T14:53:22Z</updated><content type="html">&lt;p&gt;I've just posted a write-up of some of the performance tuning I've done to improve .NET Reflector 7.2's start-up time here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.reflector.net/2011/05/net-reflector-7-start-up-time-running-out-of-gas-or-pedal-to-the-metal/"&gt;http://www.reflector.net/2011/05/net-reflector-7-start-up-time-running-out-of-gas-or-pedal-to-the-metal/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can get the new build from the .NET Reflector homepage at &lt;a href="http://www.reflector.net/"&gt;http://www.reflector.net/&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Please remember to give us your feedback in the forum, at &lt;a href="http://forums.reflector.net/"&gt;http://forums.reflector.net/&lt;/a&gt;, using the tags #7.2 and #eap.&lt;/p&gt;  &lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c3901558-adab-4e85-943c-27d32df7d4fe" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/reflector" rel="tag"&gt;reflector&lt;/a&gt;,&lt;a href="http://technorati.com/tags/early+access" rel="tag"&gt;early access&lt;/a&gt;,&lt;a href="http://technorati.com/tags/7.2" rel="tag"&gt;7.2&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=101765" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>.NET Reflector 7.2 Early Access Build 1 Released</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/05/20/101658.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/05/20/101658.aspx</id><published>2011-05-20T15:07:00Z</published><updated>2011-05-20T15:07:00Z</updated><content type="html">I've just posted up full details of this release on the .NET Reflector blog at http://www.reflector.net/2011/05/life-is-a-journey-not-a-destination-net-reflector-7-2-ea-1-has-been-released/ and, breaking with previous tradition, this includes a fairly extensive changelog.  You can download this EA build from the .NET Reflector homepage at http://www.reflector.net/.  Enjoy!  (And please don't forget to tell us what you think on the forum, http://forums.reflector.net/, using the tags #7.2 and #eap.)...(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/05/20/101658.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=101658" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>More Big News: .NET Reflector 7 Beta, Integrating Jason Haley's PowerCommands Add-in is Now Available</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2011/01/10/98258.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2011/01/10/98258.aspx</id><published>2011-01-10T18:35:00Z</published><updated>2011-01-10T18:35:00Z</updated><content type="html">We've just released .NET Reflector 7 Beta 1 and the big news is that we've acquired and integrated Jason Haley's awesome PowerCommands add-in....(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2011/01/10/98258.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=98258" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>On Her Majesty's Secret Source Code: .NET Reflector 7 Early Access Builds Now Available</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2010/12/16/96204.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2010/12/16/96204.aspx</id><published>2010-12-16T12:01:00Z</published><updated>2010-12-16T12:01:00Z</updated><content type="html">Dodgy Bond references aside, I'm extremely happy to be able to tell you that we've just released our first .NET Reflector 7 Early Access build. We're going to make these available over the coming weeks via the main .NET Reflector download page at:  http://reflector.red-gate.com/Download.aspx  Please have a play and tell us what you think in the forum we've set up. Also, please let us know if you run into any problems in the same place.  The new version so far comes with numerous decompilation improvements...(&lt;a href="http://www.simple-talk.comhttp://www.simple-talk.com/community/blogs/bart/archive/2010/12/16/96204.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=96204" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>ReSharper C# Live Template for Declaring Routed Event</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2010/11/30/95927.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2010/11/30/95927.aspx</id><published>2010-11-30T14:46:14Z</published><updated>2010-11-30T14:46:14Z</updated><content type="html">&lt;p&gt;Here's another WPF ReSharper Live Template for you. This one is for declaring standalone routed events of any type. Again, it's pretty simple:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;font color="black"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; #region $EVENTNAME$ Routed &lt;/font&gt;&lt;font color="blue"&gt;Event&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public static readonly &lt;/font&gt;&lt;font color="black"&gt;RoutedEvent $EVENTNAME$Event &lt;/font&gt;&lt;font color="blue"&gt;= &lt;/font&gt;&lt;font color="black"&gt;EventManager.RegisterRoutedEvent&lt;/font&gt;&lt;font color="gray"&gt;( &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="darkred"&gt;&amp;quot;$EVENTNAME$&amp;quot;&lt;/font&gt;&lt;font color="gray"&gt;,&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;RoutingStrategy.$ROUTINGSTRATEGY$&lt;/font&gt;&lt;font color="gray"&gt;,&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;typeof&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$EVENTHANDLERDELEGATE$ &lt;/font&gt;&lt;font color="gray"&gt;),&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;typeof&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$DECLARINGTYPE$ &lt;/font&gt;&lt;font color="gray"&gt;) );&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;public event &lt;/font&gt;&lt;font color="black"&gt;$EVENTHANDLERDELEGATE$ $EVENTNAME$&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; add { AddHandler&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$EVENTNAME$Event&lt;/font&gt;&lt;font color="gray"&gt;, &lt;/font&gt;&lt;font color="black"&gt;value &lt;/font&gt;&lt;font color="gray"&gt;); &lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remove { RemoveHandler&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$EVENTNAME$Event&lt;/font&gt;&lt;font color="gray"&gt;, &lt;/font&gt;&lt;font color="black"&gt;value &lt;/font&gt;&lt;font color="gray"&gt;); &lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;protected virtual void &lt;/font&gt;&lt;font color="black"&gt;On$EVENTNAME$&lt;/font&gt;&lt;font color="gray"&gt;()&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; RaiseEvent&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="blue"&gt;new &lt;/font&gt;&lt;font color="black"&gt;$EVENTARGSTYPE$&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$EVENTNAME$Event&lt;/font&gt;&lt;font color="gray"&gt;, &lt;/font&gt;&lt;font color="blue"&gt;this &lt;/font&gt;&lt;font color="gray"&gt;) );&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;$END$&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; #endregion&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Here are my previous posts along the same lines:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://www.simple-talk.com/community/blogs/bart/archive/2010/11/30/95923.aspx"&gt;ReSharper C# Live Template for Read-Only Dependency Property and Routed Event Boilerplate&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://www.simple-talk.com/community/blogs/bart/archive/2010/11/10/95593.aspx"&gt;ReSharper C# Live Template for Dependency Property and Property Change Routed Event Boilerplate Code&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:f4a010f1-82a8-493f-8163-0ecbb8860a0b" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/resharper" rel="tag"&gt;resharper&lt;/a&gt;,&lt;a href="http://technorati.com/tags/live+template" rel="tag"&gt;live template&lt;/a&gt;,&lt;a href="http://technorati.com/tags/c%23" rel="tag"&gt;c#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/routed+event" rel="tag"&gt;routed event&lt;/a&gt;,&lt;a href="http://technorati.com/tags/wpf" rel="tag"&gt;wpf&lt;/a&gt;,&lt;a href="http://technorati.com/tags/boilerplate" rel="tag"&gt;boilerplate&lt;/a&gt;,&lt;a href="http://technorati.com/tags/code+generation" rel="tag"&gt;code generation&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=95927" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry><entry><title>ReSharper C# Live Template for Read-Only Dependency Property and Routed Event Boilerplate</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/bart/archive/2010/11/30/95923.aspx" /><id>http://www.simple-talk.com/community/blogs/bart/archive/2010/11/30/95923.aspx</id><published>2010-11-30T12:28:00Z</published><updated>2010-11-30T12:28:00Z</updated><content type="html">&lt;p&gt;Following on from my previous post, &lt;a href="http://www.simple-talk.com/community/blogs/bart/archive/2010/11/10/95593.aspx"&gt;where I shared a Live Template for quickly declaring a normal read-write dependency property and its associated property change event boilerplate&lt;/a&gt;, here's an unsurprisingly similar template for creating a read-only dependency property.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;font color="black"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; #region $PROPNAME$ Read&lt;/font&gt;&lt;font color="gray"&gt;-&lt;/font&gt;&lt;font color="black"&gt;Only Property and Property Change Routed &lt;/font&gt;&lt;font color="blue"&gt;Event&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; private static readonly &lt;/font&gt;&lt;font color="black"&gt;DependencyPropertyKey $PROPNAME$PropertyKey &lt;/font&gt;&lt;font color="blue"&gt;= &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;DependencyProperty.RegisterReadOnly&lt;/font&gt;&lt;font color="gray"&gt;( &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="darkred"&gt;&amp;quot;$PROPNAME$&amp;quot;&lt;/font&gt;&lt;font color="gray"&gt;, &lt;/font&gt;&lt;font color="blue"&gt;typeof &lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$PROPTYPE$ &lt;/font&gt;&lt;font color="gray"&gt;), &lt;/font&gt;&lt;font color="blue"&gt;typeof &lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$DECLARING_TYPE$ &lt;/font&gt;&lt;font color="gray"&gt;), &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;new &lt;/font&gt;&lt;font color="black"&gt;PropertyMetadata&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$DEF_VALUE$ &lt;/font&gt;&lt;font color="gray"&gt;, &lt;/font&gt;&lt;font color="black"&gt;On$PROPNAME$Changed &lt;/font&gt;&lt;font color="gray"&gt;) );&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;public static readonly &lt;/font&gt;&lt;font color="black"&gt;DependencyProperty $PROPNAME$Property &lt;/font&gt;&lt;font color="blue"&gt;=&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;$PROPNAME$PropertyKey.DependencyProperty&lt;/font&gt;&lt;font color="gray"&gt;;&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;public &lt;/font&gt;&lt;font color="black"&gt;$PROPTYPE$ $PROPNAME$ &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; { &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { &lt;/font&gt;&lt;font color="blue"&gt;return &lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$PROPTYPE$ &lt;/font&gt;&lt;font color="gray"&gt;) &lt;/font&gt;&lt;font color="black"&gt;GetValue&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$PROPNAME$Property &lt;/font&gt;&lt;font color="gray"&gt;); &lt;/font&gt;&lt;font color="black"&gt;} &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;private &lt;/font&gt;&lt;font color="black"&gt;set { SetValue&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$PROPNAME$PropertyKey&lt;/font&gt;&lt;font color="gray"&gt;, &lt;/font&gt;&lt;font color="black"&gt;value &lt;/font&gt;&lt;font color="gray"&gt;); &lt;/font&gt;&lt;font color="black"&gt;} &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;public static readonly &lt;/font&gt;&lt;font color="black"&gt;RoutedEvent $PROPNAME$ChangedEvent&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;=&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;EventManager.RegisterRoutedEvent&lt;/font&gt;&lt;font color="gray"&gt;(&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="darkred"&gt;&amp;quot;$PROPNAME$Changed&amp;quot;&lt;/font&gt;&lt;font color="gray"&gt;,&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;RoutingStrategy.$ROUTINGSTRATEGY$&lt;/font&gt;&lt;font color="gray"&gt;,&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;typeof&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;RoutedPropertyChangedEventHandler&lt;/font&gt;&lt;font color="gray"&gt;&amp;lt; &lt;/font&gt;&lt;font color="black"&gt;$PROPTYPE$ &lt;/font&gt;&lt;font color="gray"&gt;&amp;gt; ),&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;typeof&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$DECLARING_TYPE$ &lt;/font&gt;&lt;font color="gray"&gt;) );&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;public event &lt;/font&gt;&lt;font color="black"&gt;RoutedPropertyChangedEventHandler&lt;/font&gt;&lt;font color="gray"&gt;&amp;lt; &lt;/font&gt;&lt;font color="black"&gt;$PROPTYPE$ &lt;/font&gt;&lt;font color="gray"&gt;&amp;gt; &lt;/font&gt;&lt;font color="black"&gt;$PROPNAME$Changed&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; add { AddHandler&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$PROPNAME$ChangedEvent&lt;/font&gt;&lt;font color="gray"&gt;, &lt;/font&gt;&lt;font color="black"&gt;value &lt;/font&gt;&lt;font color="gray"&gt;); &lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; remove { RemoveHandler&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;$PROPNAME$ChangedEvent&lt;/font&gt;&lt;font color="gray"&gt;, &lt;/font&gt;&lt;font color="black"&gt;value &lt;/font&gt;&lt;font color="gray"&gt;); &lt;/font&gt;&lt;font color="black"&gt;}&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;private static void &lt;/font&gt;&lt;font color="black"&gt;On$PROPNAME$Changed&lt;/font&gt;&lt;font color="gray"&gt;(&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;DependencyObject d&lt;/font&gt;&lt;font color="gray"&gt;, &lt;/font&gt;&lt;font color="black"&gt;DependencyPropertyChangedEventArgs e&lt;/font&gt;&lt;font color="gray"&gt;) &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;{ &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var $DECLARING_TYPE_var$ &lt;/font&gt;&lt;font color="blue"&gt;= &lt;/font&gt;&lt;font color="black"&gt;d as $DECLARING_TYPE$&lt;/font&gt;&lt;font color="gray"&gt;; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;var args &lt;/font&gt;&lt;font color="blue"&gt;= new &lt;/font&gt;&lt;font color="black"&gt;RoutedPropertyChangedEventArgs&lt;/font&gt;&lt;font color="gray"&gt;&amp;lt; &lt;/font&gt;&lt;font color="black"&gt;$PROPTYPE$ &lt;/font&gt;&lt;font color="gray"&gt;&amp;gt;(&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ( &lt;/font&gt;&lt;font color="black"&gt;$PROPTYPE$ &lt;/font&gt;&lt;font color="gray"&gt;) &lt;/font&gt;&lt;font color="black"&gt;e.OldValue&lt;/font&gt;&lt;font color="gray"&gt;,&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ( &lt;/font&gt;&lt;font color="black"&gt;$PROPTYPE$ &lt;/font&gt;&lt;font color="gray"&gt;) &lt;/font&gt;&lt;font color="black"&gt;e.NewValue &lt;/font&gt;&lt;font color="gray"&gt;);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;args.RoutedEvent&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="blue"&gt;= &lt;/font&gt;&lt;font color="black"&gt;$DECLARING_TYPE$.$PROPNAME$ChangedEvent&lt;/font&gt;&lt;font color="gray"&gt;;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="black"&gt;$DECLARING_TYPE_var$.RaiseEvent&lt;/font&gt;&lt;font color="gray"&gt;( &lt;/font&gt;&lt;font color="black"&gt;args &lt;/font&gt;&lt;font color="gray"&gt;);&lt;/font&gt;&lt;font color="black"&gt;$END$&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;br /&gt;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; #endregion&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The only real difference here is the addition of the &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.dependencypropertykey.aspx"&gt;DependencyPropertyKey&lt;/a&gt;, which allows your implementation to set the value of the dependency property without exposing the setter code to consumers of your type.&lt;/p&gt;

&lt;p&gt;You'll probably find that you create read-only dependency properties much less often than read-write properties, but this should still save you some typing when you do need to do so.&lt;/p&gt;

&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:179740b2-da03-49d1-8ed5-1b1c68770496" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/resharper" rel="tag"&gt;resharper&lt;/a&gt;,&lt;a href="http://technorati.com/tags/live+template" rel="tag"&gt;live template&lt;/a&gt;,&lt;a href="http://technorati.com/tags/c%23" rel="tag"&gt;c#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dependency+property" rel="tag"&gt;dependency property&lt;/a&gt;,&lt;a href="http://technorati.com/tags/read-only" rel="tag"&gt;read-only&lt;/a&gt;,&lt;a href="http://technorati.com/tags/routed+events" rel="tag"&gt;routed events&lt;/a&gt;,&lt;a href="http://technorati.com/tags/property+change" rel="tag"&gt;property change&lt;/a&gt;,&lt;a href="http://technorati.com/tags/boilerplate" rel="tag"&gt;boilerplate&lt;/a&gt;,&lt;a href="http://technorati.com/tags/wpf" rel="tag"&gt;wpf&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=95923" width="1" height="1"&gt;</content><author><name>Bart Read</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2110</uri></author></entry></feed>
