﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>OnTheBlog</title>
    <description>All things .net, wpf, XAML, C#, Workflow Foundation and many more.</description>
    <link>http://www.ontheblog.net/CMS/Home/tabid/36/BlogId/1/Default.aspx</link>
    <language>en-US</language>
    <webMaster>davidhanson90@hotmail.com</webMaster>
    <pubDate>Mon, 06 Feb 2012 11:04:59 GMT</pubDate>
    <lastBuildDate>Mon, 06 Feb 2012 11:04:59 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.3.0.16726</generator>
    <item>
      <title>PDC 2010 cast doubt on Silverlight but what does it really mean?</title>
      <description>&lt;p&gt;In case you have been living in a hole for the last week I imagine you have probably heard on the blogsphere about the demise of Silverlight now that HTML 5 is here and Microsoft are backing it. Without getting into the details of why they would do this, I think generally its a supersmart approach for the Blue man group. HTML 5 is here to stay as far as standards for the web go its the best we've got.&lt;/p&gt;
&lt;p&gt;Either way over the weekend I had a long thought about what it means and I eventually came to the conclusion that it won't make much a huge difference and that Silverlight &amp; xaml based technologies won't be going anywhere. The reason is that although HTML 5 does provide a number of new RIA features such as vector based drawing, socket programming, asynchronous operations etc. It will still lack hugely when it comes to developing sophisticated line of business applications. It will also never be at the forefront of innovation. Technologies and trends change and proprietary tech such as Silverlight and Flash will be at the forefront of this change.&lt;/p&gt;
&lt;p&gt;A good rule of thumb is that if an application is not going to need to be deployed to the public web as most LOB's aren't then Silverlight will be the natural fit. However if it's a commercial application available to the public then HTML 5 would be a better fit. Besides I would be surprised if at some point we don't see a Silverlight to HTML compiler to bridge that gap.&lt;/p&gt;
&lt;p&gt;Eitherway change is good and that's why we are in this game!&lt;/p&gt;
&lt;p&gt;That's my 2 pence anyways. &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/wink_smile.gif" /&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/114/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/114/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=114</guid>
      <pubDate>Sun, 31 Oct 2010 21:40:04 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=114</trackback:ping>
    </item>
    <item>
      <title>Windows Phone 7 Emulator standalone installer (July bits)</title>
      <description>&lt;p&gt;Hello out there.&lt;/p&gt;
&lt;p&gt;Well I haven't updated this site for about 6 months and I thought I would try and be a little more active. The reason for my lack of posts is that I am currently in Australia travelling in a campervan and connectivity has been a bit of issue. The distraction of sunshine and beautiful sights doesn't help either.&lt;/p&gt;
&lt;p&gt;Anyways I have just started getting to grips with the July Windows Phone 7 Beta tools and came across annoying issue with the installer. Basically it makes you download 300mb of data as part of the install. As I only wanted to download the Emulator (specifically the x64 version) I hunted around the installed settings file (located in a temp directory) an eventually stumbled upon the following two links which allow you to download it seperately. Hope this helps someone else who had this problem.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194975"&gt;http://go.microsoft.com/fwlink/?LinkId=194975&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=194976"&gt;http://go.microsoft.com/fwlink/?LinkId=194976&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PS. Word to MS. Stop using online installers.... they are driving me mental on a flakey 3g connection in the bush!&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/108/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/108/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=108</guid>
      <pubDate>Sat, 24 Jul 2010 05:27:22 GMT</pubDate>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=108</trackback:ping>
    </item>
    <item>
      <title>Introducing #Fellows</title>
      <description>&lt;p&gt;Just a quick note to make readers aware of a new blogging site called &lt;a href="http://www.sharpfellows.com/"&gt;#Fellows&lt;/a&gt;. This community site aggregates the blogs of a number of smart .Netters from the UK. Enjoy.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/96/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/96/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=96</guid>
      <pubDate>Fri, 19 Mar 2010 20:58:27 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=96</trackback:ping>
    </item>
    <item>
      <title>Rx, Reactive Extensions and Observable T</title>
      <description>&lt;p&gt;I have been seeing quite a lot of talk on the tweet feeds and blog posts recently about the new Reactive Extensions that are being released. Now I was struggling to get my head around it at first but read this simple &lt;a target="_blank" href="http://blogs.msdn.com/wesdyer/archive/2009/11/18/a-brief-introduction-to-the-reactive-extensions-for-net-rx.aspx"&gt;blog post&lt;/a&gt; which really helped clarify what Rx actually offers. It seems very powerful, and could be a game changer for event processing in the same way Linq was for list data. Really like the drag and drop example in this  post as it becomes very clear the intention of the code shown below. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Define the events you wish to monitor&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;&lt;font size="2"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;var&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt; mouseDown = &lt;/span&gt;&lt;span style="color: blue; font-size: 8pt"&gt;from&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt; evt &lt;/span&gt;&lt;span style="color: blue; font-size: 8pt"&gt;in&lt;/span&gt; &lt;span style="color: teal; font-size: 8pt"&gt;Observable&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;.FromEvent&lt;&lt;/span&gt;&lt;span style="color: teal; font-size: 8pt"&gt;MouseButtonEventArg&lt;wbr&gt;&lt;/wbr&gt;s&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;&gt;(image, &lt;/span&gt;&lt;span style="color: maroon; font-size: 8pt"&gt;"MouseDown"&lt;/span&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;) &lt;br /&gt;
                &lt;/span&gt;&lt;span style="color: blue; font-size: 8pt"&gt;select&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt; evt.EventArgs.&lt;wbr&gt;&lt;/wbr&gt;GetPosition(&lt;wbr&gt;&lt;/wbr&gt;image);&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;var&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt; mouseUp = &lt;/span&gt;&lt;span style="color: teal; font-size: 8pt"&gt;Observable&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;.FromEvent&lt;&lt;/span&gt;&lt;span style="color: teal; font-size: 8pt"&gt;MouseButtonEventArg&lt;wbr&gt;&lt;/wbr&gt;s&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;&gt;(image, &lt;/span&gt;&lt;span style="color: maroon; font-size: 8pt"&gt;"MouseUp"&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;);&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;var&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt; mouseMove = &lt;/span&gt;&lt;span style="color: blue; font-size: 8pt"&gt;from&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt; evt &lt;/span&gt;&lt;span style="color: blue; font-size: 8pt"&gt;in&lt;/span&gt; &lt;span style="color: teal; font-size: 8pt"&gt;Observable&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;.FromEvent&lt;&lt;/span&gt;&lt;span style="color: teal; font-size: 8pt"&gt;MouseEventArgs&lt;/span&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;&gt;(image, "MouseMove") &lt;br /&gt;
                &lt;/span&gt;&lt;span style="color: blue; font-size: 8pt"&gt;select&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt; evt.EventArgs.&lt;wbr&gt;&lt;/wbr&gt;GetPosition(&lt;/span&gt;&lt;span style="color: blue; font-size: 8pt"&gt;this&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;);&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
&lt;p&gt;&lt;o&gt;&lt;/o&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Then define your query which will tie these events together into a logical form for your requirement (In this case drag and drop)&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9pt"&gt;var&lt;/span&gt; &lt;span style="color: #333333; font-size: 9pt"&gt;q =&lt;/span&gt; &lt;span style="color: blue; font-size: 9pt"&gt;from&lt;/span&gt; &lt;span style="color: #333333; font-size: 9pt"&gt;imageOffset&lt;/span&gt; &lt;span style="color: blue; font-size: 9pt"&gt;in&lt;/span&gt; &lt;span style="color: #333333; font-size: 9pt"&gt;mouseDown&lt;/span&gt; &lt;span style="color: #333333; font-size: 9pt"&gt;&lt;br /&gt;
        &lt;/span&gt;&lt;span style="color: blue; font-size: 9pt"&gt;from&lt;/span&gt; &lt;span style="color: #333333; font-size: 9pt"&gt;pos&lt;/span&gt; &lt;span style="color: blue; font-size: 9pt"&gt;in&lt;/span&gt; &lt;span style="color: #333333; font-size: 9pt"&gt;mouseMove.Until(&lt;wbr&gt;&lt;/wbr&gt;mouseUp)&lt;/span&gt; &lt;span style="color: #333333; font-size: 9pt"&gt;&lt;br /&gt;
        &lt;/span&gt;&lt;span style="color: blue; font-size: 9pt"&gt;select new&lt;/span&gt; &lt;span style="color: #333333; font-size: 9pt"&gt;{ X = pos.X - imageOffset.&lt;wbr&gt;&lt;/wbr&gt;X, Y = pos.Y - imageOffset.&lt;wbr&gt;&lt;/wbr&gt;Y };&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;o&gt;&lt;/o&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;And then finally subscribe to the query and perform the action we would like to process.&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;q.Subscribe(&lt;wbr&gt;&lt;/wbr&gt;value =&gt;&lt;/span&gt; &lt;span style="color: #333333; font-size: 8pt"&gt;&lt;br /&gt;
                { &lt;br /&gt;
                    &lt;/span&gt;&lt;span style="color: teal; font-size: 8pt"&gt;Canvas&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;.SetLeft(image, value.X);&lt;/span&gt; &lt;span style="color: #333333; font-size: 8pt"&gt;&lt;br /&gt;
                    &lt;/span&gt;&lt;span style="color: teal; font-size: 8pt"&gt;Canvas&lt;/span&gt;&lt;span style="color: #333333; font-size: 8pt"&gt;.SetTop(image, value.Y);&lt;/span&gt; &lt;span style="color: #333333; font-size: 8pt"&gt;&lt;br /&gt;
                });&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;What's really cool about all this is that the event subscriptions will be marshalled onto the correct thread thus avoiding cross thread access violations. VERY COOL!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/87/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/87/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=87</guid>
      <pubDate>Tue, 26 Jan 2010 10:31:57 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=87</trackback:ping>
    </item>
    <item>
      <title>Calling a generic method with Expression.Call</title>
      <description>&lt;p&gt;The other day I came across a comment in the code base of the application I'm currently working on that said the following.&lt;/p&gt;
&lt;p&gt;&lt;font color="#009933"&gt;// Having to loop through the GetMethods() array is pretty rubbish, even if we are using LINQ. If someone knows how to use GetMethod to get the generic method definition, then correct the code, email me and I'll buy you a pint.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Now looking into this issue it turns out that the author is correct, you cannot actually use &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.type.getmethod.aspx"&gt;Type.GetMethod()&lt;/a&gt; to invoke a Generic Method. As a result the approach the dev used was to call Type.GetMethods() which returns all methods on the type and then apply some linq filtering to identify the generic method they wish to invoke. Once filtered a quick call to MakeGenericMethod then you can invoke it. This is shown below.&lt;/p&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;typeof&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt;(&lt;span style="color: #2b91af"&gt;FrameworkHelper&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt"&gt;    .GetMethods()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt"&gt;    .Where(method =&gt; method.IsGenericMethod &amp;&amp; method.Name == &lt;span style="color: #a31515"&gt;"DeleteEntity"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt"&gt;    .Select(method =&gt; method.MakeGenericMethod(actualEntityType))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt"&gt;    .First()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt"&gt;    .Invoke(&lt;span style="color: blue"&gt;null&lt;/span&gt;, &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt;[] { entity });&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;So having a think about this for a bit and then recalling some great blog posts I had read from &lt;a target="_blank" href="http://community.bartdesmet.net/blogs/bart/archive/2009/08/10/expression-trees-take-two-introducing-system-linq-expressions-v4-0.aspx"&gt;Bart De Smet's blog&lt;/a&gt; about expression tree's I wondered if we could use the Expression.Call method to achieve the same results. After some tinkering with the overloads for this method I eventually figured it out and result is shown below.&lt;/p&gt;
&lt;div&gt;&lt;span style="color: #2b91af; font-size: 9.5pt"&gt;ParameterExpression&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt; param = &lt;span style="color: #2b91af"&gt;Expression&lt;/span&gt;.Parameter(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Entity&lt;/span&gt;), &lt;span style="color: #a31515"&gt;"param"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 9.5pt"&gt;var&lt;/span&gt;&lt;span style="font-size: 9.5pt"&gt; method = &lt;span style="color: #2b91af"&gt;Expression&lt;/span&gt;.Call(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;FrameworkHelper&lt;/span&gt;), &lt;span style="color: #a31515"&gt;"DeleteEntity"&lt;/span&gt;, &lt;span style="color: blue"&gt;new&lt;/span&gt;[] { &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Entity&lt;/span&gt;) }, param).Method;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9.5pt"&gt;method.Invoke(&lt;span style="color: blue"&gt;null&lt;/span&gt;, &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt;[] { entity }); &lt;/span&gt;&lt;/div&gt;
&lt;p&gt;In the code above we create an instance of a Parameter expression which requires the Type of the parameter we are going to pass to the method. Then in order to invoke the method we need to build the call expression on line 2. Here we use the Expression.Call static method which has a number of overloads.&lt;/p&gt;
&lt;p&gt;The first param is the type which holds the static method we wish to invoke, the next paramter is the method name which is passed as string. The third paramter is the types that the method signature defines. This is passed as an array of objects. Finally is the ParamExpression we constructed on the previous line. The final part once we have the methodInfo is to invoke it by passing the instance of Entity. &lt;/p&gt;
&lt;p&gt;The Expression class supports a huge array of static methods which can be used to build code dynamically and with .NET 4.0 we get a lot more support for more complex issues such as flow control, block statements etc. &lt;/p&gt;
&lt;p&gt; Hope this quick sample sparks your interest for Expressions support in .net.&lt;/p&gt;
&lt;p&gt;&lt;font style="background-color: #ffff00"&gt;Update - Had an email from Bart about this post and he has suggested an elegant approach to this problem. Bart's approach below.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;You could also have the C# compiler do all the work for you and write a simple helper method (assuming you don't need to find the method by an externally provided name at runtime...):&lt;/p&gt;
&lt;p&gt;static MethodInfo GetMethod(Expression e)&lt;br /&gt;
{&lt;br /&gt;
return ((MethodCallExpression)e.Body).Method;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Now call this as follows:&lt;/p&gt;
&lt;p&gt;GetMethod(() =&gt; new int[0].Select(x =&gt; x.ToString()))&lt;/p&gt;
&lt;p&gt;This will return the MethodInfo for Enumerable.Select.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;br /&gt;
-Bart&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/85/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/85/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=85</guid>
      <pubDate>Sun, 17 Jan 2010 09:05:54 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=85</trackback:ping>
    </item>
    <item>
      <title>Raising binding exceptions in WPF &amp; Silverlight with .net 4.0 Dynamics</title>
      <description>&lt;div&gt;It’s been a while since I’ve posted anything. Sorry about that. This has mainly been due to a busy social and work schedule which has not given me the time I’ve needed to create the content that’s been floating around my desk as post it notes. In this post I would like to revisit dynamic typing support in .NET 4.0 and apply it to a real world scenario.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Proxying and Interception with Dynamics&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;If you’re like me then I imagine you have been playing with &lt;a target="_blank" href="http://msdotnetsupport.blogspot.com/2009/06/27-new-features-of-net-framework-40.html"&gt;&lt;font color="#0000ff"&gt;.NET 4.0&lt;/font&gt;&lt;/a&gt; for quite a while now. There is a wealth of new language features to play with in this release and I’m excited about the RTM come march. One of the features I have discussed previously is the support for dynamic typing. &lt;a target="_blank" href="http://geekswithblogs.net/sdorman/archive/2008/11/16/c-4.0-dynamic-programming.aspx"&gt;&lt;font color="#0000ff"&gt;Dynamics&lt;/font&gt;&lt;/a&gt; brings with it some new approaches to problems that &lt;a href="http://en.wikipedia.org/wiki/Strongly_typed_programming_language"&gt;&lt;font color="#0000ff"&gt;static languages&lt;/font&gt;&lt;/a&gt; have often found difficult to solve. In this post we will be looking at the topic of dynamic proxying, interception and &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Aspect-oriented_programming"&gt;&lt;font color="#0000ff"&gt;AOP&lt;/font&gt;&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The common goal of these techniques is to allow a programmer to be able to inject code transparently before and after a method has been invoked. This is illustrated below in the diagram below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;p align="center"&gt;&lt;img alt="" width="600" height="319" src="http://www.ontheblog.net/CMS/Portals/0/Images/ProxyPattern.jpg" /&gt;&lt;/p&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;If you have not come across this concept before you may ask what is the point of intercepting a method before and after execution. A layer of &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Indirection"&gt;&lt;font color="#0000ff"&gt;indirection&lt;/font&gt;&lt;/a&gt; is particularly useful when trying to inject code between a client and our objects. The reason we do this as it allows us to implement secondary support functions such as logging, transaction management, code contracts and other utility code outside the body of our method. What we find when we implement an proxy pattern is that once we have removed this secondary code the readability of our code improves tremendously and we have also increased our &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Separation_of_concerns"&gt;&lt;font color="#0000ff"&gt;separation of concerns&lt;/font&gt;&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now you can see the benefits of this approach, let’s turn our attention to how we go about implementing this in our code. Luckily for us there has been a lot of smart people working hard to help make this process easier. If you do a search for proxy pattern’s or aspect orientated programming you will find a heap of information. When it comes to AOP there are a number of frameworks which have already been developed. These are listed below. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Aspect#&lt;/div&gt;
&lt;div&gt;Encase AOP&lt;/div&gt;
&lt;div&gt;Spring.NET&lt;/div&gt;
&lt;div&gt;Aspect.NET&lt;/div&gt;
&lt;div&gt;AspectDNG&lt;/div&gt;
&lt;div&gt;Dynamic Proxy&lt;/div&gt;
&lt;div&gt;Compose*&lt;/div&gt;
&lt;div&gt;Loom.NET&lt;/div&gt;
&lt;div&gt;PostSharp&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Each of these frameworks make use of a number techniques to the injection of code both before and after execution of a method. These generally fall into 4 categories.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="color: #e36c0a"&gt;MSIL injection&lt;/span&gt;&lt;/strong&gt; – Here we inject MSIL code into the body of the method being executed. (Post sharp)&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="color: #e36c0a"&gt;Runtime dynamic injection&lt;/span&gt;&lt;/strong&gt; – Using techniques such as reflection we invoke methods dynamically.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="color: #e36c0a"&gt;Type builder injection&lt;/span&gt;&lt;/strong&gt; – Related to runtime injection, we create a type based on the type we wish to proxy and then marshal requests through this type. (&lt;a target="_blank" href="http://www.castleproject.org/dynamicproxy/index.html"&gt;&lt;font color="#0000ff"&gt;Dynamic Proxy&lt;/font&gt;&lt;/a&gt;)&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="color: #e36c0a"&gt;Container injection&lt;/span&gt;&lt;/strong&gt; – Requests pass through a container which invokes code before and after our method being executed.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;WPF Bindings with dynamic objects&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So now that C# 4.0 brings with it support for dynamic objects I thought I would take a look at how I can go about implementing a simple interception pattern for static objects. I am currently working on a project which makes extensive use of WPF. We follow and&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/magazine/cc188690.aspx"&gt;&lt;font color="#0000ff"&gt; MVP&lt;/font&gt;&lt;/a&gt; pattern and our views are bound directly to our presenters in order to reduce the amount of code in our views. If you have worked with WPF you will probably know some of the great benefits of the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/aa480224.aspx"&gt;&lt;font color="#0000ff"&gt;binding model&lt;/font&gt;&lt;/a&gt;. Using simple XAML expressions you can bind controls to properties deep down in your object graph. However, sometimes you need to do something a little more complicated. If you have use data templates for list controls you may have found the need to bind to something that’s way up the visual tree. Below is a good example of this.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 10pt"&gt;&lt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: 10pt"&gt;Button&lt;/span&gt;&lt;span style="color: red; font-size: 10pt"&gt; Command&lt;/span&gt;&lt;span style="color: blue; font-size: 10pt"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515; font-size: 10pt"&gt;Binding&lt;/span&gt;&lt;span style="color: red; font-size: 10pt"&gt; RelativeSource&lt;/span&gt;&lt;span style="color: blue; font-size: 10pt"&gt;={&lt;/span&gt;&lt;span style="color: #a31515; font-size: 10pt"&gt;RelativeSource&lt;/span&gt;&lt;span style="color: red; font-size: 10pt"&gt; FindAncestor&lt;/span&gt;&lt;span style="color: blue; font-size: 10pt"&gt;,&lt;/span&gt;&lt;span style="color: red; font-size: 10pt"&gt; AncestorType&lt;/span&gt;&lt;span style="color: blue; font-size: 10pt"&gt;={&lt;/span&gt;&lt;span style="color: #a31515; font-size: 10pt"&gt;x&lt;/span&gt;&lt;span style="color: blue; font-size: 10pt"&gt;:&lt;/span&gt;&lt;span style="color: #a31515; font-size: 10pt"&gt;Type&lt;/span&gt;&lt;span style="color: red; font-size: 10pt"&gt; UserControl&lt;/span&gt;&lt;span style="color: blue; font-size: 10pt"&gt;}},&lt;/span&gt;&lt;span style="color: red; font-size: 10pt"&gt; Path&lt;/span&gt;&lt;span style="color: blue; font-size: 10pt"&gt;=DataContext.AddPerson&lt;span style="background: yellow"&gt;Comand&lt;/span&gt;}"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;In this scenario I have bound a button command to a command definition which sits on my presenter. However, you will notice I made a deliberate mistake. I spelt the word command wrong in the path. As a result WPF will fail to locate the binding and when I actually click on this button nothing will happen. This is frustrating and there things I can do to identify this issue. Bea Costa has some good posts around this topic &lt;a target="_blank" href="http://beacosta.com/blog/?p=52"&gt;&lt;font color="#0000ff"&gt;here&lt;/font&gt;&lt;/a&gt;. The problem with these approaches are that none of them are particularly obvious to the developer.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;What I would really like is to be able to throw an exception whenever a binding fails. I would also like to show debug statements printed in my output window when a binding access occurs. As I already have a substantial codebase that I do not have the time or urge to go through in order to support this functionality I want to do it in a low impact way.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Building the Dynamic Binding Interceptor&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;When we look at how I bind my presenter you can see it’s a fairly simple affair. My view Implements IBindableView which exposes the Views DataContext to the presenter. Therefore it’s a trivial process for creating the binding.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;View.DataContext = &lt;span style="color: blue"&gt;this&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;It at this point where I would like to attack the problem at hand. As dynamic objects use &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Dynamic_dispatch"&gt;&lt;font color="#0000ff"&gt;dynamic dispatch&lt;/font&gt;&lt;/a&gt; to query a type, my best approach is to set the views data context to be a dynamic object of my choice and then route the requests to my presenter. The key thing here is that I do not want to change my existing presenter code in anyway. I want my binding code to look like this.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;View.DataContext = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt;(&lt;span style="color: blue"&gt;this&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Given that, I need to create my new interceptor class and implement the behaviours I mentioned. To do this we need to create a new class that inherits from &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.dynamic.dynamicobject(VS.100).aspx"&gt;&lt;font color="#0000ff"&gt;DynamicObject&lt;/font&gt;&lt;/a&gt; and provide a constructor which takes our source for binding. This class is show below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Provides interception of properties for bound objects.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt;: &lt;span style="color: #2b91af"&gt;DynamicObject&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        &lt;span style="color: blue"&gt;protected&lt;/span&gt; &lt;span style="color: blue"&gt;dynamic&lt;/span&gt; Source{ &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; BindingInterceptor(&lt;span style="color: blue"&gt;dynamic&lt;/span&gt; source)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            Source = source;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;You can see that we store the source for future use. The interception of properties will be achieved by overriding two methods on DynamicObject. These are shown below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; TryGetMember(&lt;span style="color: #2b91af"&gt;GetMemberBinder&lt;/span&gt; binder, &lt;span style="color: blue"&gt;out&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; result)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;base&lt;/span&gt;.TryGetMember(binder, &lt;span style="color: blue"&gt;out&lt;/span&gt; result);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; TrySetMember(&lt;span style="color: #2b91af"&gt;SetMemberBinder&lt;/span&gt; binder, &lt;span style="color: blue"&gt;object&lt;/span&gt; value)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;base&lt;/span&gt;.TrySetMember(binder, value);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;These two methods will be invoked whenever our View tries to access a property on its data context, which in our case will be the our BindingInterceptor. It would be a simple task to implement the desired behaviour of logging and throwing exceptions within our BindingInterceptor, however on this occasion I would like something a little more flexible. Instead I would like to be able to instruct the BindingInterceptor of the behaviours I would like it to execute before and after accessing a property. Looking back at our binding code, I would now rather it looked more like the following.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;bindingInterceptor&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;    .OnGet&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        .BeforeGet((binding) =&gt; &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"TRY GET: Name={0}"&lt;/span&gt;, binding.Name)))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        .AfterGet((binding, value) =&gt; &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"GET RESULT: Name={0}, Value={1}, Result={2}"&lt;/span&gt;, binding.Name, value, &lt;span style="color: #a31515"&gt;"Success"&lt;/span&gt;)))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        .IfGetException((binding, exception) =&gt; { &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;BindingException&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"Failed to Get [{0}]"&lt;/span&gt;, binding.Name), exception); })&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;    .OnSet&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        .BeforeSet((binding, value) =&gt; &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"TRY SET: Name={0}, Value={1}"&lt;/span&gt;, binding.Name, value)))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        .AfterSet((binding, value) =&gt; &lt;span style="color: #2b91af"&gt;Debug&lt;/span&gt;.WriteLine(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"SET RESULT: Name={0}, Value={1}, Result={2}"&lt;/span&gt;, binding.Name,value, &lt;span style="color: #a31515"&gt;"Success"&lt;/span&gt;)))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        .IfSetException((binding, exception) =&gt; { &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;BindingException&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"Failed to Set [{0}]"&lt;/span&gt;, binding.Name), exception); });&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Although this code is more verbose, it does allow me to specify exactly what I would like implemented on access of properties. It also uses a fluent interface which to a reader who is new to the code should be relatively easy to follow. In order to implement this in our BindingInterceptor we need to add a few simple methods which will take an Action as their input and return an instance of the BindingInterceptor. These methods are shown below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;public&lt;/span&gt;&lt;span style="font-size: 8pt"&gt; &lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt; OnGet { &lt;span style="color: blue"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;; } }&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;public&lt;/span&gt;&lt;span style="font-size: 8pt"&gt; &lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt; OnSet { &lt;span style="color: blue"&gt;get&lt;/span&gt; { &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;; } }&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;public&lt;/span&gt;&lt;span style="font-size: 8pt"&gt; &lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt; BeforeGet(&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;GetMemberBinder&lt;/span&gt;&gt; beforeGet)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    BeforeGetPropertyDelegate = beforeGet;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;public&lt;/span&gt;&lt;span style="font-size: 8pt"&gt; &lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt; AfterGet(&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;GetMemberBinder&lt;/span&gt;, &lt;span style="color: blue"&gt;object&lt;/span&gt;&gt; afterGet)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    AfterGetPropertyDelegate = afterGet;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;public&lt;/span&gt;&lt;span style="font-size: 8pt"&gt; &lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt; BeforeSet(&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;SetMemberBinder&lt;/span&gt;, &lt;span style="color: blue"&gt;object&lt;/span&gt;&gt; beforeSet)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    BeforeSetPropertyDelegate = beforeSet;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;public&lt;/span&gt;&lt;span style="font-size: 8pt"&gt; &lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt; AfterSet(&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;SetMemberBinder&lt;/span&gt;, &lt;span style="color: blue"&gt;object&lt;/span&gt;&gt; afterSet)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    AftersetPropertyDelegate = afterSet;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;public&lt;/span&gt;&lt;span style="font-size: 8pt"&gt; &lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt; IfGetException(&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;GetMemberBinder&lt;/span&gt;,&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt;&gt; getException)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    GetExceptionDelegate = getException;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 8pt"&gt;public&lt;/span&gt;&lt;span style="font-size: 8pt"&gt; &lt;span style="color: #2b91af"&gt;BindingInterceptor&lt;/span&gt; IfSetException(&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;SetMemberBinder&lt;/span&gt;,&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt;&gt; setException)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    SetExceptionDelegate = setException;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;    &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 8pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now we have the ability to inform the BindingInterceptor of the behaviours we would like it to carry out, the final task for us to do is make sure that the these behaviours are invoked and that the value is marshalled to and from our source presenter. I have highlighted this below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; GetValue(&lt;span style="color: #2b91af"&gt;GetMemberBinder&lt;/span&gt; binder, &lt;span style="color: blue"&gt;out&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; result)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            &lt;span style="color: blue"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (BeforeGetPropertyDelegate != &lt;span style="color: blue"&gt;null&lt;/span&gt;) &lt;span style="background: yellow"&gt;BeforeGetPropertyDelegate(binder);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                &lt;span style="color: #2b91af"&gt;Type&lt;/span&gt; type = Source.GetType();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                result = type.GetProperties().FirstOrDefault(p =&gt; p.Name == binder.Name).GetValue(Source, &lt;span style="color: blue"&gt;null&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (AfterGetPropertyDelegate != &lt;span style="color: blue"&gt;null&lt;/span&gt;) &lt;span style="background: yellow"&gt;AfterGetPropertyDelegate(binder, result);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            &lt;span style="color: blue"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt; exception)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (GetExceptionDelegate != &lt;span style="color: blue"&gt;null&lt;/span&gt;) &lt;span style="background: yellow"&gt;GetExceptionDelegate(binder, exception);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; SetValue(&lt;span style="color: #2b91af"&gt;SetMemberBinder&lt;/span&gt; binder, &lt;span style="color: blue"&gt;object&lt;/span&gt; value)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            &lt;span style="color: blue"&gt;try&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (BeforeSetPropertyDelegate != &lt;span style="color: blue"&gt;null&lt;/span&gt;) &lt;span style="background: yellow"&gt;BeforeSetPropertyDelegate(binder, value);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                &lt;span style="color: #2b91af"&gt;Type&lt;/span&gt; type = Source.GetType();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                type.GetProperties().FirstOrDefault(p =&gt; p.Name == binder.Name).SetValue(Source,value,&lt;span style="color: blue"&gt;null&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (AftersetPropertyDelegate != &lt;span style="color: blue"&gt;null&lt;/span&gt;) &lt;span style="background: yellow"&gt;AftersetPropertyDelegate(binder, value);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            &lt;span style="color: blue"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt; exception)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (SetExceptionDelegate != &lt;span style="color: blue"&gt;null&lt;/span&gt;) &lt;span style="background: yellow"&gt;SetExceptionDelegate(binder, exception);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;To test our BindingInterceptor I need to create a simple user interface. I want to be able to bind two presenters, one good presenter that meets all the requirements of the bound controls and one bad presenter that wont.&lt;/div&gt;
&lt;p align="center"&gt;&lt;img alt="" width="600" height="359" src="http://www.ontheblog.net/CMS/Portals/0/Images/dynamicBindingUI.jpg" /&gt;&lt;/p&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;When we click the “Bind good presenter” option we use our BindingInterceptor to wrap our presenter instance and then set this as the data context of the window. Doing this provides us with the following output in the debug window. &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------BEGIN GET--------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;TRY GET: Name=LikeDynamics&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;GET RESULT: Name=LikeDynamics, Value=True, Result=Success&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------END GET----------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------BEGIN GET--------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;TRY GET: Name=WantToSeeMore&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;GET RESULT: Name=WantToSeeMore, Value=True, Result=Success&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------END GET----------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------BEGIN GET--------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;TRY GET: Name=Comments&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;GET RESULT: Name=Comments, Value=Good presenter is bound., Result=Success&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------END GET----------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;You can see the initial binding of the data context causes our control bindings to refresh the values from their source. Each of these requests is serviced via our BindingInterceptor. If we then uncheck the “I like .net 4.0 dynamics?” checkbox we can see the value being passed from the windows through our interceptor and into our good presenter.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------BEGIN SET--------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;TRY SET: Name=LikeDynamics, Value=False&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;SET RESULT: Name=LikeDynamics, Value=False, Result=Success&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------END SET----------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------BEGIN GET--------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;TRY GET: Name=LikeDynamics&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;GET RESULT: Name=LikeDynamics, Value=False, Result=Success&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------END GET----------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now we have met the first objective of our interceptor class. We have provided a level of logging without having to change our existing presenter code. Our second objective was to raise exceptions when a binding fails. We do this by selecting the “Bind Bad Presenter” option which does not have the properties required for binding.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;----------------BEGIN GET--------------------&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;TRY GET: Name=LikeDynamics&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;System.Windows.Data Error: 17 : Cannot get 'LikeDynamics' value (type 'Object') from '' (type 'BindingInterceptor'). BindingExpression:Path=LikeDynamics; DataItem='BindingInterceptor' (HashCode=7063836); target element is 'CheckBox' (Name=''); target property is 'IsChecked' (type 'Nullable`1') BindingException:'DynamicInterceptor.BindingException: Failed to Get [LikeDynamics] ---&gt; Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime binding on a null reference&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This time we can see that the request to read the property “LikeDynamics” fails with an Binding exception. This is as expected as we defined this in our BindingInterceptor behaviours. However, unfortunately for us the application does not raise any exceptions and therefore the binding is invisible. This is &lt;strong&gt;NOT&lt;/strong&gt; what we want. The reason this occurs is due to the fact that when WPF attempts to access a binding it is wrapped in an TryCatch block and the exception is hidden. As part of this post I did take the time to look through the .NET source code and actually found the code where this occurs. I noticed that all exceptions are ignored accept a number of Critical exception types. These exceptions such as StackOverflow, OutOfMemory, NullReference are the only ones which will bubble up to the surface. Therefore If I want my custom binding exception to be raised, I need to ensure the exception inherits from NullReferenceException. Making this small change and rebinding to the bad presenter now causes an exception to be thrown.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;In this post I wanted to introduce a new approach to proxying using c# 4.0 dynamics. This simple example should have provided you with a good insight into interception techniques. From there it opens the door for whole range of exciting opportunities to solve complex problems. You can see the code required to implement this pattern is minimal. I plan to follow up this post with a series of posts which will outline some cool uses for dynamic interception in a range of problems. This approach can be used for both Silverlight and WPF as Microsoft are making great efforts to support dynamics across technologies.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;If you want the source code for this post you can download it &lt;a href="http://www.ontheblog.net/CMS/Portals/0/DynamicInterceptor.zip"&gt;here.&lt;/a&gt;&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/77/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/77/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=77</guid>
      <pubDate>Mon, 14 Dec 2009 14:00:19 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=77</trackback:ping>
    </item>
    <item>
      <title>Defensive coding source available.</title>
      <description>&lt;p&gt;I had a request to make the defensive coding source code available.  So here you go.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.ontheblog.net/CMS/Portals/0/Files/Defensive.zip"&gt;Download&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/76/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/76/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=76</guid>
      <pubDate>Sun, 13 Dec 2009 09:57:57 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=76</trackback:ping>
    </item>
    <item>
      <title>Extension method to find the nearest common ancestor of a given type.</title>
      <description>&lt;p&gt;I had a problem recently where I had an &lt;a target="_blank" href="http://www.iua.upf.es/~xamat/Thesis/html/node11.html"&gt;inheritance hierarchy&lt;/a&gt; of which I needed to find a common ancestor type between two objects. Below shows a quick mock up of the situation I faced.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img alt="" width="387" height="497" src="http://www.ontheblog.net/CMS/Portals/0/FindCommonAncestorType.jpg" /&gt;&lt;/p&gt;
&lt;p align="left"&gt;As you can see the Person type is the common ancestor for both Student and Teacher. In order to solve this issue I decided to write the following extension method for the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.type.aspx"&gt;Type&lt;/a&gt; type to be able to locate it easily in the future. Code below for anyone interested. Hope it helps.&lt;/p&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Extension methods for the Type&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;TypeExtensions&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Finds the nearest common ancestor for a given type.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="type" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The type.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="targetType" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;Type of the target.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;returns&gt;&lt;/returns&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Type&lt;/span&gt; FindCommonAncestor (&lt;span style="color: blue"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Type&lt;/span&gt; type, &lt;span style="color: #2b91af"&gt;Type&lt;/span&gt; targetType)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (targetType.IsAssignableFrom(type))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;return&lt;/span&gt; targetType;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; baseType = targetType.BaseType;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;while&lt;/span&gt;(baseType != &lt;span style="color: blue"&gt;null&lt;/span&gt; &amp;&amp; !baseType.IsPrimitive)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (baseType.IsAssignableFrom(type))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                    &lt;span style="color: blue"&gt;return&lt;/span&gt; baseType;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                baseType = baseType.BaseType;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; &lt;span style="color: blue"&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/75/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/75/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=75</guid>
      <pubDate>Thu, 10 Sep 2009 14:51:25 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=75</trackback:ping>
    </item>
    <item>
      <title>RDL Parameter Reader</title>
      <description>&lt;p&gt;I currently working on retro fitting some SQL server reports into the application we are building. I needed a quick way to view all the parameters each report uses. The code below is a quick snippet to do just that. Just point it at a directory with the RDL files in an away you go.  Note: This code does the bare minimum and is used for SQL Server 2005 RDL. I haven't checked to see if it works on SQL 2008 RDL. Thought it might help someone.&lt;/p&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;       &lt;span style="color: blue"&gt;public&lt;/span&gt; Report()&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            {&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                Parameters = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Parameter&lt;/span&gt;&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; ReportName { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Parameter&lt;/span&gt;&gt; Parameters{ &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;;}&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Represents a report parameter.&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Parameter&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        {&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; Name { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; DataType { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; DefaultValue { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; Hidden { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        }&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Gets the report parameters.&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="location" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The location.&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Report&lt;/span&gt;&gt; GetReportParameters(&lt;span style="color: blue"&gt;string&lt;/span&gt; location)&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        {&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (!&lt;span style="color: #2b91af"&gt;Directory&lt;/span&gt;.Exists(location.Trim()))&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Could not find the location specified"&lt;/span&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: green"&gt;//Get the RDL files&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; directoryInfo = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;DirectoryInfo&lt;/span&gt;(location);&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; rdlFiles = directoryInfo.GetFiles(&lt;span style="color: #a31515"&gt;"*.rdl"&lt;/span&gt;);&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;var&lt;/span&gt; reports = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Report&lt;/span&gt;&gt;();&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: green"&gt;//For each file we will extract the parameters.&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;foreach&lt;/span&gt;(&lt;span style="color: blue"&gt;var&lt;/span&gt; fileInfo &lt;span style="color: blue"&gt;in&lt;/span&gt; rdlFiles)&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            {&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                &lt;span style="color: blue"&gt;var&lt;/span&gt; report = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Report&lt;/span&gt; {ReportName = fileInfo.Name};&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                &lt;span style="color: blue"&gt;var&lt;/span&gt; xDocument = &lt;span style="color: #2b91af"&gt;XDocument&lt;/span&gt;.Load(&lt;span style="color: #2b91af"&gt;File&lt;/span&gt;.OpenText(fileInfo.FullName));&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                &lt;span style="color: blue"&gt;var&lt;/span&gt; parameters =&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                    xDocument.Descendants()&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                        .Where(node =&gt; node.Name.LocalName == &lt;span style="color: #a31515"&gt;"ReportParameters"&lt;/span&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                        .Nodes()&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                        .Select(param =&gt; &lt;span style="color: #2b91af"&gt;XElement&lt;/span&gt;.Load(param.CreateReader()))&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                        .Select&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                        (&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                            param =&gt; &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                            &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Parameter&lt;/span&gt;()&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                                {&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                                    DataType = SafeRead(() =&gt; param.Elements().FirstOrDefault(xe =&gt; xe.Name.LocalName == &lt;span style="color: #a31515"&gt;"DataType"&lt;/span&gt;).Value),&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                                    Hidden = SafeRead(() =&gt;param.Elements().FirstOrDefault(xe =&gt; xe.Name.LocalName == &lt;span style="color: #a31515"&gt;"Hidden"&lt;/span&gt;).Value),&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                                    Name = SafeRead(()=&gt;param.Attribute(&lt;span style="color: #a31515"&gt;"Name"&lt;/span&gt;).Value)&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                                }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                        )&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                        .ToList();&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                report.Parameters.AddRange(parameters);&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;                reports.Add(report);&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; reports;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;&lt;font size="1"&gt;        }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/74/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/74/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=74</guid>
      <pubDate>Fri, 28 Aug 2009 08:17:58 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=74</trackback:ping>
    </item>
    <item>
      <title>NDC 2009 Videos</title>
      <description>&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Tim Huckaby - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4458"&gt;&lt;font size="2"&gt;Jump into Windows Presentation Foundation! ...and Become Immediately Effective&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Scott Hanselman - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4465"&gt;&lt;font size="2"&gt;Deep Tour of .NET 4&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Ted Neward - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4470"&gt;&lt;font size="2"&gt;Why the Next Five Years Will Be About Languages&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Michael Feathers - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4482"&gt;&lt;font size="2"&gt;Seven Blind Alleys in Software Design&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Jonas Follesø - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4459"&gt;&lt;font size="2"&gt;MVVM Patterns for Silverlight and WPF applications&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Scott Hanselman - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4466"&gt;&lt;font size="2"&gt;Making Your Blog Suck Less: Social Networking and Your Personal Brand Online&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Luca Bolognese - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4471"&gt;&lt;font size="2"&gt;The Future of C#&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Udi Dahan - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4478"&gt;&lt;font size="2"&gt;Reliability, Availability, and Scalability - How to have your cake, and eat it too&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Michael Feathers - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4483"&gt;&lt;font size="2"&gt;Working Effectively with the Legacy Code: Taming the Wild Code Base&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Tim Huckaby - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4460"&gt;&lt;font size="2"&gt;Declarative UI Programming with XAML: Windows Presentation Foundation, Silverlight &amp; Surface&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Phil Haack - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4467"&gt;&lt;font size="2"&gt;Black Belt Ninja Tips ASP.NET MVC&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Michael Feathers - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4472"&gt;&lt;font size="2"&gt;Functional Thinking for Object-Oriented Designers&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Robert C. Martin - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4477"&gt;&lt;font size="2"&gt;Clean Code: Functions&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Jeremy D. Miller - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4484"&gt;&lt;font size="2"&gt;Lessons Learned from a Long Lived Codebase&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Ian Griffiths - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4462"&gt;&lt;font size="2"&gt;Writing Custom Windows Presentation Foundation Pixel Shader Effects&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Phil Haack - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4468"&gt;&lt;font size="2"&gt;ASP.NET MVC + AJAX = meant for each other&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Luca Bolognese - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4473"&gt;&lt;font size="2"&gt;An Introduction to Microsoft F#&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Tim Huckaby - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4463"&gt;&lt;font size="2"&gt;Building Data Visualization Applications with the Windows Presentation Foundation&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Phil Haack &amp; Scott Hanselman - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4469"&gt;&lt;font size="2"&gt;The Haacked and Hanselman Show&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Ted Neward - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4474"&gt;&lt;font size="2"&gt;The Busy Developer's Guide to ECMA(Java)Script&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Jonas Follesø - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4480"&gt;&lt;font size="2"&gt;Building Business Applications in Silverlight 3&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Udi Dahan - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4486"&gt;&lt;font size="2"&gt;Intentions and Interfaces - Making Patterns Complete&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Jeremy D. Miller -&lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4464"&gt;&lt;font size="2"&gt; Presentation Patterns for Composite Applications&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Ayende Rahien - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4475"&gt;&lt;font size="2"&gt;Writing Domain Specific Languages in Boo&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Tim Huckaby - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4481"&gt;&lt;font size="2"&gt;Integrating Windows Presentation Foundation and Windows Communications Foundation into Your Office Business Applications&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 38.25pt"&gt;&lt;font size="2"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Arial'"&gt;         &lt;/span&gt;&lt;/span&gt;Michael Feathers - &lt;/font&gt;&lt;a href="http://media01.smartcom.no/Microsite/start.aspx?eventid=4495"&gt;&lt;font size="2"&gt;Design Sense Deep Lessons in Software Design&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/73/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/73/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=73</guid>
      <pubDate>Fri, 03 Jul 2009 10:25:54 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=73</trackback:ping>
    </item>
    <item>
      <title>Defensive Coding</title>
      <description>&lt;div&gt;How often have you seen code like this?&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="color: blue; font-size: 10pt"&gt;private&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; AllocateRoles(&lt;span style="color: #2b91af"&gt;RoleChangeInfo&lt;/span&gt; roleChangeInfo)&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt"&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;Role&lt;/span&gt; role &lt;span style="color: blue"&gt;in&lt;/span&gt; roleChangeInfo.Roles)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (roleChangeInfo.Person.Age &gt; 21 &amp;&amp; roleChangeInfo.Person &lt;span style="color: blue"&gt;is&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Senior&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                    RoleChangeService.AddRole(rolechangeInfo.Person, role);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;      }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;If we deconstruct this code we can see that the method &lt;strong&gt;AllocateRoles&lt;/strong&gt; should received an instance of a &lt;span style="color: #2b91af; font-size: 10pt"&gt;RoleChangeInfo&lt;/span&gt; which is a container for all the information that is required to add the roles to the appropriate person. If we take a look at the implementation of this type we can see that it’s fairly simplistic.  It holds the ID of the Role and a RoleTaken DateTime.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 10pt"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Role&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; ID { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;? RoleTaken { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div&gt;The body of the AllocateRoles method consists of a simple ForEach iteration around the Roles collection and with each role we check to make sure the person is older than 21 and they are of type senior. If both of these conditions are true then we call the &lt;u&gt;RoleChangeService.AddRole method which will perform the work and update the RoleTaken&lt;/u&gt;.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I have come across this kind of code many times in the past and it is a good example of where a developer has made a number of assumptions and have not thought about making the AllocateRoles method &lt;u&gt;defensive&lt;/u&gt;.  So before we jump into making this code defensive let’s take a look at some of the possible issues with this code.  Can you see them?&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Developer Assumptions&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;That roleChangeInfo will not be null&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;That the Roles collection will be initialised&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;That each role within the Roles collection will not be null&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;That the roleChangeInfo.Person will not be null&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;That it is ok to call this method when the Person is not a senior&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;That it is ok to call this method with when the person is younger than 21&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;That it is ok to call this method and no roles are present.&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;That it is ok to exit this method without checking to see if our Role.RoleTaken has been set.&lt;/div&gt;
&lt;div style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;None of the Roles.RoleTaken stamps have already been set.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;From the list of items above you get the idea.  The code in AllocateRoles takes the path of least resistance and should invalid data be passed in no specific exceptions will be raised. This can result in two possible outcomes. Firstly, the code crashes with a null reference exception and we spend hours trying to find the cause of the issue or the code executes a scenario that is considered invalid. This can lead to data corruption and a large headache trying to figure out where it’s happening.  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Enter Defensive coding&lt;/strong&gt; – When we apply defensive coding techniques to this method we are trying to attain 2 possible outcomes. Firstly we wish to identify all possible errors within our method and throw exceptions if any of them are met. Secondly, we want to ensure that no business functionality will be executed accidently and that the results of our code is sound. Given this, let’s take another stab at our AllocateRoles method.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 10pt"&gt;private&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; AllocateRoles(&lt;span style="color: #2b91af"&gt;RoleChangeInfo&lt;/span&gt; roleChangeInfo)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;      &lt;span style="color: green"&gt;//CHECK: that we have a valid rolechangeInfo and that we have a Person and that the person&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: green; font-size: 10pt"&gt;      //is of type Senior and that the roles collection is not null. &lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: blue; font-size: 10pt"&gt;if&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; (roleChangeInfo != &lt;span style="color: blue"&gt;null&lt;/span&gt; &amp;&amp; roleChangeInfo.Person != &lt;span style="color: blue"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    &amp;&amp; roleChangeInfo.Person.GetType() == &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Senior&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    &amp;&amp; roleChangeInfo.Roles != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;         &lt;span style="color: green"&gt;// CHECK:  that we actuall have roles.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;if&lt;/span&gt; (roleChangeInfo.Roles.Count == 0)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ApplicationException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"You must specify at least one role."&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; role &lt;span style="color: blue"&gt;in&lt;/span&gt; roleChangeInfo.Roles)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: green; font-size: 10pt"&gt;  // CHECK:  we dont have a null role.&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (role == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;NullReferenceException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Role cannot be null"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: green; font-size: 10pt"&gt;  // CHECK:  that the Role Taken has not been set.&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (role.RoleTaken != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ApplicationException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Role has already been taken."&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-indent: 36pt; margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: green; font-size: 10pt"&gt;  // CHECK:  that the Persons ages is not less than 21.&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (roleChangeInfo.Person.Age &lt; 21)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ApplicationException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"You cannot allocate roles to seniors under 21"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: green"&gt;//DO OUR WORK HERE&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;        RoleChangeService.AddRole(rolechangeInfo.Person,role)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: green"&gt;// CHECK:  all roles have a taken date.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;if&lt;/span&gt; (roleChangeInfo.Roles.Exists(role =&gt; role.RoleTaken == &lt;span style="color: blue"&gt;null&lt;/span&gt;))&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ApplicationException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Role taken date has not been set."&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;As you can see the method implementation above now performs a number of checks on the input data and where appropriate throws exceptions if the state is invalid.  At this point we could consider this method defensive enough for our purposes. However by implementing numerous checks on the state of the data we have lost readability of our business logic.  Secondly the checks are scattered throughout the method and the very first check still falls through and can exit with no code being run. In most cases I may not mind this but others I may want to ensure fall through does not occur. The result is that I would have to break apart this check into multiple If’s. Not ideal.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Enter Arrange, Act, Assert&lt;/strong&gt; -  If you are familiar with unit testing you may have come this pattern when creating your tests. If you haven’t I suggest you have a quick read &lt;a href="http://agileinaflash.blogspot.com/2009/03/arrange-act-assert.html"&gt;&lt;font color="#0000ff"&gt;here&lt;/font&gt;&lt;/a&gt;. But the basics of this pattern are that you &lt;u&gt;arrange &lt;/u&gt;your code in a way so that the &lt;u&gt;Act &lt;/u&gt;you are performing can execute with the desired effect and that after the work is done you can &lt;u&gt;assert &lt;/u&gt;any failures.  Once you get the hang of it it certainly makes writing tests easier. Given this, I want to refactor the method so that a reusable pattern can be established when performing defensive coding. If we look at our pattern is follows the following workflow.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Assert (Input) &lt;strong&gt;&gt;&gt;&lt;/strong&gt; Act &lt;strong&gt;&gt;&gt;&lt;/strong&gt; Assert (Output)&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Given this pattern and I what I want to achieve, I needed to create a simple utility class that would allowing me to perform daisy chaining of conditions which can then be executed at a given point. The Defensive methods such as IsNull would return instances of themselves allowing semantics such as the following.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="color: #2b91af; font-size: 10pt"&gt;Defensive&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;.CurrentMethod&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    .IsNotNull(test, &lt;span style="color: #a31515"&gt;"Message"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    .IsInstanceOfType(&lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt;(), &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: blue"&gt;object&lt;/span&gt;), &lt;span style="color: #a31515"&gt;"Type does not match"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    .IsTrue(() =&gt; 1 == 2, &lt;span style="color: #a31515"&gt;"1 wont equal 2"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;&lt;span style="font-size: 10pt"&gt;    .Check();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Using this new utility class we can now go back to our AllocateRoles method and refactor to meet AAA pattern we use in our tests. Below is the final defensive method.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="color: blue; font-size: 10pt"&gt;private&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; AllocateRoles(&lt;span style="color: #2b91af"&gt;RoleChangeInfo&lt;/span&gt; roleChangeInfo)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: green"&gt;//ASSERT Inputs&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: #2b91af"&gt;Defensive&lt;/span&gt;.CurrentMethod&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        .IsNotNull(roleChangeInfo, &lt;span style="color: #a31515"&gt;"Cannot call AllocateRoles without a roleChangeInfo"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        .IsNotNull(roleChangeInfo.Person, &lt;span style="color: #a31515"&gt;"You must have a valid Person reference"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        .AnyNull(roleChangeInfo.Roles, &lt;span style="color: #a31515"&gt;"You must specify roles"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        .IsInstanceOfType(roleChangeInfo.Person, &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Senior&lt;/span&gt;), &lt;span style="color: #a31515"&gt;"You can only apply roles to senior people"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        .IsTrue(() =&gt; roleChangeInfo.Person.Age &gt; 21, &lt;span style="color: #a31515"&gt;"You cannot allocate roles to seniors under 21"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        .IsTrue(() =&gt; roleChangeInfo.Roles.Count &gt; 0, &lt;span style="color: #a31515"&gt;"You must specify at least one role."&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        .Check();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: green"&gt;//ACT&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    roleChangeInfo.Roles.ForEach(role =&gt; RoleChangeService.AddRole(rolechangeInfo.Person, role));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: green"&gt;//ASSERT Outputs&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: #2b91af"&gt;Defensive&lt;/span&gt;.CurrentMethod&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        .IsTrue(() =&gt; !roleChangeInfo.Roles.Exists(role =&gt; role.RoleTaken == &lt;span style="color: blue"&gt;null&lt;/span&gt;), &lt;span style="color: #a31515"&gt;"Role allocation failed."&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        .Check();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;You can see that the AAA syntax coupled with the daisy chaining allows for our defensive checks to be grouped together at the top and bottom of our method. This avoids diluting our business code with numerous checks. Defensive coding is a powerful tool in our arsenal when it comes to increasing the resilence of our application code.&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/72/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/72/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=72</guid>
      <pubDate>Fri, 05 Jun 2009 06:33:18 GMT</pubDate>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=72</trackback:ping>
    </item>
    <item>
      <title>Microsoft® Silverlight™ 3 Tools Beta 1 </title>
      <description>&lt;p&gt;Want to start developing for Silverlight 3.0? Well you can now download the tools you need for Visual Studio from Microsoft.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=11dc7151-dbd6-4e39-878f-5081863cbb5d"&gt;Download here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/wink_smile.gif" /&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/71/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/71/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=71</guid>
      <pubDate>Wed, 18 Mar 2009 15:02:54 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=71</trackback:ping>
    </item>
    <item>
      <title>Silverlight 3: Some info! </title>
      <description>&lt;p align="center"&gt;&lt;img alt="" width="300" height="111" src="http://www.ontheblog.net/CMS/Portals/0/Images/MIX09Logo_2.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Today see's the start of &lt;a target="_blank" href="http://live.visitmix.com/"&gt;MIX09&lt;/a&gt;. As a result I decided to look on the agenda for the sessions that are taking place over the next few days and I came across this little nugget if information on &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Silverlight"&gt;Silverlight&lt;/a&gt; 3. The session is titled "What's new in Silverlight 3" The brief synopsis gives us a sneak peak as to what to expect from Scotts Keynote.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;"Take a tour of the new features in Silverlight 3 including a dive into some of the new experience oriented features like pixel shaders, perspective 3D, animation enhancements, bitmap APIs and improvements to the media stack. Also hear about new Silverlight base framework additions including updates to the style model, data binding improvements, improved resource handling and improvements to the web services stack."&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Looking forward to those 3D demo's already! &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/wink_smile.gif" /&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/70/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/70/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=70</guid>
      <pubDate>Wed, 18 Mar 2009 10:46:11 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=70</trackback:ping>
    </item>
    <item>
      <title>Next SLUG Meeting: Thursday 26th March 2009 </title>
      <description>&lt;p&gt;So it s been a while since I have blogged. I wont bore you with the details but what with moving home, project commitments and lots going on in my personal life I've just not had time to focus. This post is to get me started again &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;.&lt;/p&gt;
&lt;p&gt;The next SLUG meeting has been announced. You can find details of it &lt;a href="http://blogs.conchango.com/markmann/archive/2009/03/17/silverlight-uk-user-group-6-agenda.aspx"&gt;here &lt;/a&gt;. Its going to follow a GROK TALK format, this means that anyone can have 15 mins talking to the group about experiences they have had with Silverlight. Mark is also looking for MIX attendees to come along and share their thoughts on this years announcements etc.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/69/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/69/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=69</guid>
      <pubDate>Tue, 17 Mar 2009 13:51:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=69</trackback:ping>
    </item>
    <item>
      <title>Is BizTalk Dead - Part 2</title>
      <description>&lt;p&gt;Back at the beginning of the year I wrote a &lt;a target="_blank" href="http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=6"&gt;blog post&lt;/a&gt; about the awkward conflict that BizTalk faced now that &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/netframework/aa663328.aspx"&gt;WF&lt;/a&gt; was on the scene.  Although at the time of writing there was an obvious cross over between the products, BizTalk still offered a number of key advantages over bog standard workflow. Due to some emails I received I decided to look around Microsoft's code projects and see what I could find. It was way back in Feb that I &lt;a target="_blank" href="http://geekswithblogs.net/higgins/archive/2007/11/06/116660.aspx"&gt;came across OSLO&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;9 Months later and with &lt;a target="_blank" href="http://www.microsoftpdc.com/"&gt;PDC&lt;/a&gt; out of the way, &lt;a target="_blank" href="http://www.microsoft.com/soa/products/oslo.aspx"&gt;OSLO&lt;/a&gt; and Microsofts strategy for WF is far more clear. OSLO seemed to evolve over the last few months into the codename primarily used for the modelling language and toolset announced. Microsoft also showed off a whole new version of WF for .NET 4.0. This new version of WF comes with some major improvements.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;WF has been rewritten from the ground up.&lt;/li&gt;
    &lt;li&gt;Performance has been dramatically increased&lt;/li&gt;
    &lt;li&gt;Services and Workflow can be written purely with XAML&lt;/li&gt;
    &lt;li&gt;A new customisable designer surface&lt;/li&gt;
    &lt;li&gt;Large number of new activities for developing workflows&lt;/li&gt;
    &lt;li&gt;Seamless integration with WCF&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So with WF being upgraded to a spanky new version which offers a wealth of new features please bare in mind that BizTalk'ers are still waiting for their orchestration engine to be updated to use the new WF engine. Given the new version of WF being announced I would be wondering how long its going to take before I see that in BizTalk?&lt;/p&gt;
&lt;p&gt;Back to the original OSLO article I found way back in Februrary, the article talked of a new WF hosting engine. This part of the puzzle we now know has been codenamed "Dublin". If you haven't heard of Dublin yet and your into BizTalk then hold your breath as the diagram below (taken from MSDN) may look familiar.&lt;/p&gt;
&lt;p&gt; &lt;img alt="" width="683" height="484" src="http://www.ontheblog.net/CMS/Portals/0/Images/Dublin runtime.jpg" /&gt;&lt;/p&gt;
&lt;p&gt; Dublin is the application server that has long been missing from the Microsoft product set. Announced to be a part of Windows Server , Dublin provides a runtime which hosts WF workflows and provides services for persistence, tracking, management, message forwarding and much more. The Dublin runtime is implemented on SQL Server server which allows WF developers to create long running workflows. Prior to Dublin this was only possible by either rolling your own or implementing BizTalk.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Is this sounding familiar to you?&lt;/strong&gt; Well it doesn't stop there I'm afraid. Dublin can also run as part of farm of servers whereby each instance  can use a single shared persistence store. Dublin also provides automatic workflow activation as part of its message routing architecture.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img alt="" width="578" height="271" src="http://www.ontheblog.net/CMS/Portals/0/Images/dublin scalability.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;As you can see Dublin is the future. Even Microsoft recognise the awkward overlap of features as evidenced by this &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/dd200919.aspx"&gt;MSDN article.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;For anybody familiar with BizTalk Server, looking at “Dublin” might cause a slight sense of déjà vu. Supporting workflow-based logic, providing a monitoring and management infrastructure: These are things that BizTalk Server does today. What’s the future of BizTalk Server in a “Dublin” world?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;The key thing to understand is that “Dublin” doesn’t directly target traditional BizTalk scenarios. For example, enterprise application integration and business-to-business connections via EDI will still use BizTalk Server. Similarly, bringing existing applications into the service-oriented world by exposing their functions and/or data through BizTalk Server will continue to make sense. While the reach of “Dublin” may grow over time, BizTalk Server remains important for connecting the Microsoft application platform to the diverse systems common in most enterprises. &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;If an organization needs an application container for WCF services, however, especially those implemented using WF, “Dublin” is a better choice—this is what it’s designed for. And expect BizTalk Server’s connection with “Dublin” to get stronger: Look for a future release after BizTalk Server 2009 to build on the “Dublin” infrastructure. Even though the functions of BizTalk Server and “Dublin” appear to overlap in some ways, each technology has a clear role to play.&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;So where do we stand? In my opinion I think BizTalks days are numbered, apart from some BAM, Adaptors and some tools there is very little separating the two technologies. Key to remember is that Dublin is where the innovation is happening and I dont expect to see that change.  If your a BizTalk dev today I recommend getting yourself orientated with WF and Dublin asap.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/68/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/68/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=68</guid>
      <pubDate>Wed, 26 Nov 2008 21:18:25 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=68</trackback:ping>
    </item>
    <item>
      <title>Silverlight 3D confirmed! </title>
      <description>&lt;p&gt;Scott Gu has a &lt;a target="_blank" href="http://weblogs.asp.net/scottgu/archive/2008/11/16/update-on-silverlight-2-and-a-glimpse-of-silverlight-3.aspx"&gt;post today&lt;/a&gt; highlighting a couple of features that we can expect to see in Silverlight 3. Good to hear on the list are the following&lt;/p&gt;
&lt;p&gt;• Increased databinding support (Lets hope we get element binding)&lt;br /&gt;
• 3D graphics support (With GPU Acceleration)&lt;br /&gt;
• H.264 Codecs for high quality video streams.&lt;/p&gt;
&lt;p&gt;His full post can be found &lt;a target="_blank" href="http://weblogs.asp.net/scottgu/archive/2008/11/16/update-on-silverlight-2-and-a-glimpse-of-silverlight-3.aspx"&gt;here&lt;/a&gt;. &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/67/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/67/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=67</guid>
      <pubDate>Mon, 17 Nov 2008 14:16:48 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=67</trackback:ping>
    </item>
    <item>
      <title>C# 4.0 and Dynamic Objects Part 1</title>
      <description>&lt;div&gt;&lt;span style="font-size: 8pt"&gt;
&lt;p&gt;&lt;font size="2"&gt;Over the last week I have been watching a number of sessions that were recorded at PDC. One that I particularly enjoyed was Anders Hejlsberg “Future of C#”.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;During this talk Anders provides a brief introduction to dynamics support in C#. If you’re not sure what dynamics really are then the best way to describe it is the ability to perform lazy evaluation of an objects data type &amp; members at runtime. To make this clearer we can look at C# as it stands today as a purely static language. If we define a new class within c# 3.5 show below we are generally bound to use only the members that have been defined on the contract.&lt;/font&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;PlainOldObject&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; Name { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; Age { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;    }&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;Now when it comes to using the PlainOldObject class we can only do so in a limited way as compilation will fail if we try to access properties that do not exist. Take for example&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;PlainOldObject&lt;/span&gt; plainOldObject = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;PlainOldObject&lt;/span&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.Name = &lt;span style="color: #a31515"&gt;"Dave Hanson"&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.Age = 30;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.&lt;span style="color: red"&gt;FavouriteLanguage&lt;/span&gt; = &lt;span style="color: #a31515"&gt;"c#"&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;This fails compilation with an error of “&lt;em&gt;'PlainOldObject' does not contain a definition for 'FavouriteLanguage'&lt;/em&gt;”. In order to get this code to compile in our current c# 3.5 code we need to go back to the class and implement a new property called FavouriteLanguage of type string. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;strong&gt;&lt;font size="2"&gt;Introducing the Dynamic Type&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;Dynamics support in c# 4.0 solves this issue for us! In C# 4.0 a new static type is being introduced called dynamic. The dynamic type tells the c# compiler to ignore type checking at compile and instead leave the evaluation until runtime. The dynamic type can be applied to any .net type but more importantly it can be applied to external resources such as XML, COM objects and Scripts. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;So given we have late binding of members now supported in C# 4.0 with the use of the dynamic type what will our code example from above look like. This is show below. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;dynamic&lt;/span&gt; plainOldObject = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;PlainOldObject&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.Name = &lt;span style="color: #a31515"&gt;"Dave Hanson"&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.Age = 30;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.FavouriteLanguage = &lt;span style="color: #a31515"&gt;"c#"&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;span style="font-size: 8pt"&gt;As you can see the code looks almost identical. Apart from the dynamic keyword nothing else has changed. However, under C# 4.0, when you go to compile you will not be faced with a compilation error as was shown before. &lt;/span&gt;&lt;span style="font-size: 8pt"&gt;At this point we can see that the compiler is no longer checking all the members of the type during compile but we are still faced with the issue that our PlainOldObject does not actually implement the property FavouriteLanguages. In fact, running the code will cause an exception to be throw. &lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;The next issue we need to solve is how we go about create a dynamic object that can be extended arbitrarily. To do this, we follow the approach most dynamic languages follow. As types have no fixed structure in dynamic languages they must store their data in a generic way, therefore they often implement an internal collection within the type which will store data for each dynamic property is set. Implementing this pattern in C# 4.0 is relatively straight forward. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;strong&gt;&lt;font size="2"&gt;Introducing DynamicObject&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;In order for us to create our own dynamic objects Microsoft have provides us with an abstract class called DynamicObject. This abstract class has a number of virtual methods which we can override and that provide interceptors for all method invocations, property getters and setters as well some other useful functions. This is shown below. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;abstract&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;DynamicObject&lt;/span&gt; : IDynamicObject&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; GetMember(GetMemberBinder info);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; SetMember(SetMemberBinder info, &lt;span style="color: blue"&gt;object&lt;/span&gt; value);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; DeleteMember(DeleteMemberBinder info);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; UnaryOperation(UnaryOperationBinder info);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; BinaryOperation(BinaryOperationBinder info, &lt;span style="color: blue"&gt;object&lt;/span&gt; arg);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; Convert(ConvertBinder info);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; Invoke(InvokeBinder info, &lt;span style="color: blue"&gt;object&lt;/span&gt;[] args);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; InvokeMember(InvokeMemberBinder info, &lt;span style="color: blue"&gt;object&lt;/span&gt;[] args);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; CreateInstance(CreateInstanceBinder info, &lt;span style="color: blue"&gt;object&lt;/span&gt;[] args);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; GetIndex(GetIndexBinder info, &lt;span style="color: blue"&gt;object&lt;/span&gt;[] indices);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; SetIndex(SetIndexBinder info, &lt;span style="color: blue"&gt;object&lt;/span&gt;[] indices, &lt;span style="color: blue"&gt;object&lt;/span&gt; value);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;virtual&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; DeleteIndex(DeleteIndexBinder info, &lt;span style="color: blue"&gt;object&lt;/span&gt;[] indices);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; MetaObject IDynamicObject.GetMetaObject();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;    }&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;So in order to allow our PlainOldObject to support dynamic behaviour we need to inherit the DynamicObject class and then override the GetMember and SetMember methods. In our implementation of these methods we need to ensure that if the SetMember is called we place a value into the internal dictionary of values held within PlainOldObject and if the GetMember is called we need to retrieve the value. Below is an example of this code. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;PlainOldObject&lt;/span&gt; : DynamicObject&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;,&lt;span style="color: blue"&gt;object&lt;/span&gt;&gt; _members = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;,&lt;span style="color: blue"&gt;object&lt;/span&gt;&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; GetMember(&lt;span style="color: #2b91af"&gt;GetMemberAction&lt;/span&gt; member)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; _members[member.Name];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;override&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; SetMember(&lt;span style="color: #2b91af"&gt;SetMemberAction&lt;/span&gt; member, &lt;span style="color: blue"&gt;object&lt;/span&gt; value)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;           _members[member.Name] = value;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 10pt"&gt;    }&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;And that’s it.... were done. We now have an extensible dynamic object that can be extended without having to implement new properties. &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;dynamic&lt;/span&gt; plainOldObject = &lt;span style="color: blue"&gt;new&lt;/span&gt; PlainOldObject();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.Name = &lt;span style="color: #a31515"&gt;"Dave Hanson"&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.Age = 30;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.FavouriteLanguage = &lt;span style="color: #a31515"&gt;"c#"&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.Height = 6.0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.Sex = &lt;span style="color: #a31515"&gt;"Male"&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            plainOldObject.Foo = &lt;span style="color: #a31515"&gt;"Bar"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/66/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/66/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=66</guid>
      <pubDate>Thu, 13 Nov 2008 00:19:26 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=66</trackback:ping>
    </item>
    <item>
      <title>Silverlight UK usergroup session video - 1</title>
      <description>&lt;p&gt;If you didn't manage to make it to the &lt;a target="_blank" href="http://blogs.conchango.com/michelleflynn/archive/2008/11/06/a-very-successful-silverlight-user-group-event.aspx"&gt;Silverlight UK user group&lt;/a&gt; last week then you may want to check out this video below. This is session one by &lt;a target="_blank" href="http://www.trickybusiness.co.uk/"&gt;TrickyBusiness&lt;/a&gt; who outline there design approach. Enjoy.&lt;/p&gt;
&lt;p&gt;&lt;object id="xrPlayerEmbededb5ee9156088d452588b5c98462ce5b70" name="\""+name+"\"" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="646" height="396" returntype="\"javascript\"" initializevideo="function () {
return eval(instance.CallFunction("&lt;invoke name=\""+name+"\" returntype=\"javascript\"&gt;" + __flash__argumentsToXML(arguments,0) + "&lt;/invoke&gt;"));
}" extractposterframe="function () {
return eval(instance.CallFunction("&lt;invoke name=\""+name+"\" returntype=\"javascript\"&gt;" + __flash__argumentsToXML(arguments,0) + "&lt;/invoke&gt;"));
}"&gt;
&lt;param name="_cx" value="17092" /&gt;
&lt;param name="_cy" value="10478" /&gt;
&lt;param name="FlashVars" value="" /&gt;
&lt;param name="Movie" value="http://exposureroom.com/flash/xrVideoPlayer.swf?domain=exposureroom.com/&amp;assetId=b5ee9156088d452588b5c98462ce5b70&amp;size=md&amp;titleColor=white" /&gt;
&lt;param name="Src" value="http://exposureroom.com/flash/xrVideoPlayer.swf?domain=exposureroom.com/&amp;assetId=b5ee9156088d452588b5c98462ce5b70&amp;size=md&amp;titleColor=white" /&gt;
&lt;param name="WMode" value="Transparent" /&gt;
&lt;param name="Play" value="-1" /&gt;
&lt;param name="Loop" value="-1" /&gt;
&lt;param name="Quality" value="High" /&gt;
&lt;param name="SAlign" value="" /&gt;
&lt;param name="Menu" value="-1" /&gt;
&lt;param name="Base" value="" /&gt;
&lt;param name="AllowScriptAccess" value="always" /&gt;
&lt;param name="Scale" value="ShowAll" /&gt;
&lt;param name="DeviceFont" value="0" /&gt;
&lt;param name="EmbedMovie" value="0" /&gt;
&lt;param name="BGColor" value="" /&gt;
&lt;param name="SWRemote" value="" /&gt;
&lt;param name="MovieData" value="" /&gt;
&lt;param name="SeamlessTabbing" value="1" /&gt;
&lt;param name="Profile" value="0" /&gt;
&lt;param name="ProfileAddress" value="" /&gt;
&lt;param name="ProfilePort" value="0" /&gt;
&lt;param name="AllowNetworking" value="all" /&gt;
&lt;param name="AllowFullScreen" value="false" /&gt;&lt;/object&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/65/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/65/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=65</guid>
      <pubDate>Wed, 12 Nov 2008 14:58:28 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=65</trackback:ping>
    </item>
    <item>
      <title>Goodbye Linq to SQL?</title>
      <description>&lt;p&gt;An interesting &lt;a target="_blank" href="http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx"&gt;post&lt;/a&gt; has arrived on the Ado.net team blog with regard to the future of LINQ to SQL. Although not coming outright and saying it, it seems that LINQ to SQL is likely to be deprecated in the future in favour of Entity Framework. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;“We’re making significant investments in the Entity Framework such that as of .NET 4.0 the Entity Framework will be our recommended data access solution for LINQ to relational scenarios”&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So this leaves the question, what will customers who have implemented LINQ to SQL do for long term support. I would like to see Microsoft provide clear guidelines and tooling in order to help those unfortunate ones migrate their existing software forward. The good news is that the awkward gap between LINQ to SQL and EntityFramework now seems to have been resolved.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/64/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/64/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=64</guid>
      <pubDate>Fri, 31 Oct 2008 13:44:31 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=64</trackback:ping>
    </item>
    <item>
      <title>New Silverlight Controls</title>
      <description>&lt;p&gt;For those of you coming from WPF to Silverlight you often find yourself frustrated when you find that Silverlight is lacking some very useful controls that you take for granted. Well today at least that gap is narrowing..... As here you will find on codeplex the Silverlight Toolkit. &lt;a href="http://www.codeplex.com/Silverlight"&gt;http://www.codeplex.com/Silverlight&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;With this release you get additional layout controls such as Dockpanel, ViewBox, Wrap panels etc as well as some more advance controls such as expanders and &lt;strong&gt;&lt;u&gt;charting&lt;/u&gt;&lt;/strong&gt;!&lt;/p&gt;
&lt;p align="center"&gt;&lt;img alt="" width="594" height="199" src="http://www.ontheblog.net/CMS/Portals/0/Images/silverlighttoolkit.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;I heard a while back these would becoming as an additional download so glad to see them finally arrive. Expect ALOT more in the near future!&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/63/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/63/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=63</guid>
      <pubDate>Wed, 29 Oct 2008 23:02:25 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=63</trackback:ping>
    </item>
    <item>
      <title>PDC: Office via Silverlight</title>
      <description>&lt;p&gt;Well there are announcements coming left right and center from PDC this year. We've heard about &lt;a target="_blank" href="http://www.microsoft.com/azure/default.mspx"&gt;Azure&lt;/a&gt; and Microsoft's move to provide cloud services. We hear details of &lt;a target="_blank" href="http://www.microsoft.com/soa/products/oslo.aspx"&gt;Oslo&lt;/a&gt; and Dublin and what they will mean for the future of language developement and modelling.&lt;/p&gt;
&lt;p&gt;And then one very important announcment from Microsoft which shows their commitment to Silverlight and related technologies is the announcement that the next version of Office will come with a web enabled version powered by Silverlight. Their is a video posted on Channel 9 about this that shows small demos of Silverlight Word, Excel and One Note. VERY COOL!&lt;/p&gt;
&lt;p align="center"&gt;&lt;iframe height="325" src="http://channel9.msdn.com/posts/PDCNews/435973/player/" frameborder="0" width="320" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;This is the future of RIA's and software as a service and I am looking forward to see how Microsoft's competitors continue to compete now that Silverlight and .Net are going cross platform.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/62/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/62/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=62</guid>
      <pubDate>Tue, 28 Oct 2008 20:34:47 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=62</trackback:ping>
    </item>
    <item>
      <title>New .NET Logo!</title>
      <description>&lt;p&gt;Well after 8 years Microsoft has decided to update the .NET Logo. I always like the old one but I think the new one is even better.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img alt="" width="240" height="74" src="http://www.ontheblog.net/CMS/Portals/0/Images/image_3.png" /&gt;&lt;/p&gt;
&lt;p align="left"&gt;I've read in the blogs that this new logo is already in place around PDC. One thing about this logo is that it brings a feeling of familiarity and I'm not sure why. Perhaps its because it uses similar colours and gradients as those found in Photoshop CS3?&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/61/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/61/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=61</guid>
      <pubDate>Sun, 26 Oct 2008 08:36:35 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=61</trackback:ping>
    </item>
    <item>
      <title>Silverlight 2 Released! </title>
      <description>&lt;p&gt;Well its official, Silverlight 2 is now complete and available to the public. The full press statement can be read here.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.microsoft.com/presspass/press/2008/oct08/10-13Silverlight2PR.mspx"&gt;http://www.microsoft.com/presspass/press/2008/oct08/10-13Silverlight2PR.mspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The total download size weighs in at 4.64Mb so still pretty compact. Hats of to Microsoft for squeezing so much functionality in!&lt;/p&gt;
&lt;p&gt;Highlights of new Silverlight 2 features include the following:&lt;/p&gt;
&lt;p&gt;• .NET Framework support with a rich base class library. This is a compatible subset of the full .NET Framework.&lt;br /&gt;
 &lt;br /&gt;
• Powerful built-in controls. These include DataGrid, ListBox, Slider, ScrollViewer, Calendar controls and more.&lt;br /&gt;
 &lt;br /&gt;
• Advanced skinning and templating support. This makes it easy to customize the look and feel of an application.&lt;br /&gt;
 &lt;br /&gt;
• Deep zoom. This enables unparalleled interactivity and navigation of ultrahigh resolution imagery.&lt;br /&gt;
 &lt;br /&gt;
• Comprehensive networking support. Out-of-the-box support allows calling REST, WS*/SOAP, POX, RSS and standard HTTP services, enabling users to create applications that easily integrate with existing back-end systems.&lt;br /&gt;
 &lt;br /&gt;
• Expanded .NET Framework language support. Unlike other runtimes, Silverlight 2 supports a variety of programming languages, including Visual Basic, C#, JavaScript, IronPython and IronRuby, making it easier for developers already familiar with one of these languages to repurpose their existing skill sets.&lt;br /&gt;
 &lt;br /&gt;
• Advanced content protection. This now includes Silverlight DRM, powered by PlayReady, offering robust content protection for connected Silverlight experiences.&lt;br /&gt;
 &lt;br /&gt;
• Improved server scalability and expanded advertiser support. This includes new streaming and progressive download capabilities, superior search engine optimization techniques, and next-generation in-stream advertising support.&lt;br /&gt;
 &lt;br /&gt;
• Vibrant partner ecosystem. Visual Studio Industry Partners such as ComponentOne LLC, Infragistics Inc. and Telerik Inc. are providing products that further enhance developer capabilities when creating Silverlight applications using Visual Studio.&lt;br /&gt;
 &lt;br /&gt;
• Cross-platform and cross-browser support. This includes support for Mac, Windows and Linux in Firefox, Safari and Windows Internet Explorer.&lt;br /&gt;
 &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/60/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/60/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=60</guid>
      <pubDate>Tue, 14 Oct 2008 11:22:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=60</trackback:ping>
    </item>
    <item>
      <title>NHibernate Query Generator</title>
      <description>&lt;p&gt;My good friend &lt;a target="_blank" href="https://blogs.conchango.com/andrewclancy/default.aspx"&gt;Andrew Clancy&lt;/a&gt; at Conchango has written an interesting blog post about the benefits of using the &lt;a href="http://ayende.com/Blog/archive/2006/07/31/IntroducingTheNHibernateQueryGenerator.aspx"&gt;NHibernate Query Generator.&lt;/a&gt; We have been actively using this in our project and we find benefits every day. Check it out.&lt;/p&gt;
&lt;p&gt;Blog post &lt;a target="_blank" href="https://blogs.conchango.com/andrewclancy/archive/2008/10/10/nhibernate-query-generator-in-action.aspx"&gt;here&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/59/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/59/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=59</guid>
      <pubDate>Fri, 10 Oct 2008 11:01:38 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=59</trackback:ping>
    </item>
    <item>
      <title>Remix 08: Silverlight Info and Leaks</title>
      <description>&lt;p align="center"&gt;&lt;img alt="" width="376" height="417" src="http://www.ontheblog.net/CMS/Portals/0/Images/scottgu.jpg" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;Scott demonstrating ASP.net MVC&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Well &lt;a target="_blank" href="http://www.microsoft.com/uk/remix08/"&gt;Remix &lt;/a&gt;is over and my thoughts post event was that it was a bit of let down. Unfortunately &lt;a target="_blank" href="http://www.microsoftpdc.com/"&gt;PDC&lt;/a&gt; is right around the corner and as a result no new major announcements were being made. Before attending I made a promise to myself to mix equally between design and development orientated sessions.&lt;/p&gt;
&lt;p&gt;While there I got to speak to some great people and discuss topics ranging from visualisation techniques to the duplex communication in Silverlight. I was also lucky enough to grab a few moments of &lt;a target="_blank" href="http://weblogs.asp.net/Scottgu/"&gt;Scott Gu’s&lt;/a&gt; time and discuss a few Silverlight specifics. &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;No MergeDictionaries for RTM&lt;/strong&gt; - I was mortified to hear that MergeDictionaries is not going to make it into the RTM. I cannot believe that we have to specify all our styles and resources in our App.xaml for the foreseeable future.  This is particularly annoying if you are trying to migrate a WPF app to Silverlight.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://en.wikipedia.org/wiki/H.264"&gt;&lt;strong&gt;H264&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; will miss RTM&lt;/strong&gt; – I kind of expected this one as it was only recently announced. But Scott clarified it.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Charting controls coming&lt;/strong&gt; – It looks like the Silverlight team are working hard on more advanced controls and Scott let slip that charting controls are to be included.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Silverlight automatic update&lt;/strong&gt; – In one of Scott’s sessions he confirmed that Silver light 2 Beta 2 installs will automatically upgrade to the RTM.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Ribbon bar for WPF on track&lt;/strong&gt; – It looks like the Ribbon for WPF should be due sometime this year. I asked if we can expect to see this in Silverlight soon and he confirmed it was NOT on the current development schedule. (Damn).&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;Silverlight not the preferred platform&lt;/strong&gt; – I asked Scott if I could expect to see innovation happening in the Silverlight space from now on given that the VSM was developed for Silverlight first. Scott said there was no particular decision on which came first, however they will be trying and reduce the issue of code portability between WPF and Silverlight apps.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;And Finally - 3D&lt;/strong&gt; was pretty much confirmed. When asked by a member of the audience when will we see 3D support in Silverlight Scott’s grin couldn’t be hidden. He kept saying “Well that would be a compelling option”. I’m expecting to see this announced at PDC.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So generally I had a good couple of days but felt some of the session’s could have been a little more tech and less big picture. Next year perhaps.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/57/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/57/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=57</guid>
      <pubDate>Tue, 23 Sep 2008 19:54:04 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=57</trackback:ping>
    </item>
    <item>
      <title>Great looking silverlight Ribbon bar!! </title>
      <description>&lt;p&gt;I was surfing the web this morning and I came across &lt;a target="_blank" href="http://home.infusionblogs.com/smatthews/Lists/Posts/Post.aspx?ID=1"&gt;this impressive Office Ribbon&lt;/a&gt; bar implementation by &lt;a target="_blank" href="http://home.infusionblogs.com/smatthews/default.aspx"&gt;Simon Matthews&lt;/a&gt; at Infusion. He has uploaded a demo of the control and at it is mightly impressive.&lt;/p&gt;
&lt;p align="center"&gt;&lt;a target="_blank" href="http://msbluelight-0.agappdom.net/e1/d/60108/12953379/63356904000/0.9Z8OSBfzngVyUE7MphrSgofaiTU/zziframehtml2zz.html#%2f%2fappId%2fSilverlightRibbon.xap%2f%2ftrue%2f%2f%2f%2f%2ftrue%2f2.0%2f0"&gt;&lt;img alt="" width="500" height="104" src="http://www.ontheblog.net/CMS/Portals/0/Images/silverRibbon.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;I will be following his work eagerly as its something so far I think Microsoft has failed to deliver to developers. Why they have not delivered these controls I am not clear, but my hunch is that they are trying to capitalise on the uniqueness of the ribbon bar in office before they allow the rest of us the goodness. Eitherway, great job Simon.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/56/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/56/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=56</guid>
      <pubDate>Sat, 13 Sep 2008 08:55:05 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=56</trackback:ping>
    </item>
    <item>
      <title>Silverlight UK User Group #2 Agenda</title>
      <description>&lt;p&gt;&lt;a href="http://blogs.conchango.com/markmann/default.aspx"&gt;Mark Mann&lt;/a&gt; form &lt;a href="http://www.conchango.com/"&gt;Conchango&lt;/a&gt; has posted some info on the agenda for the Silverlight UK user group on the 14th August. Unfortuantely I am out of country when this one is on. Gutted.  But you can find out some more information here.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.conchango.com/markmann/archive/2008/08/01/silverlight-uk-user-group-2-agenda-announced.aspx"&gt;http://blogs.conchango.com/markmann/archive/2008/08/01/silverlight-uk-user-group-2-agenda-announced.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and here&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.conchango.com/michelleflynn/archive/2008/08/01/silverlight-agenda-announced.aspx"&gt;http://blogs.conchango.com/michelleflynn/archive/2008/08/01/silverlight-agenda-announced.aspx&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/55/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/55/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=55</guid>
      <pubDate>Fri, 01 Aug 2008 14:13:23 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=55</trackback:ping>
    </item>
    <item>
      <title>SQL Server: How to page query results</title>
      <description>&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif'"&gt;&lt;font size="2"&gt;The application I am working on at the moment has a large number of complex search screens that allow the user to define either very narrow or very broad query's. A great deal of effort has been spent in optimising the queries in order to ensure they are performant. However, if a user decided to execute a very broad query, the result set that could be returned could be many thousands of records. Let’s take a look at a broad query using this simple SQL.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 8pt; font-family: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;Select&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;  ID&lt;span style="color: gray"&gt;,&lt;/span&gt; Forename&lt;span style="color: gray"&gt;,&lt;/span&gt; Surname&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;FROM&lt;/span&gt;         Person &lt;span style="color: blue"&gt;Where&lt;/span&gt; Surname &lt;span style="color: gray"&gt;like&lt;/span&gt; &lt;span style="color: red"&gt;'%DA%'&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;In this query we want to return everything from our person table where the surname contains the letter “DA”. Running this query gives us the following 99 results. I’ve randomized the data in our person data for privacy reasons.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="399" alt="" width="429" src="http://www.ontheblog.net/CMS/Portals/0/Images/results1.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Now this query is running on some test data but on a live system it might return 20,000+ records. Transferring this data from our DB server to our application tier, then into business entities and serialising them via soap to our client is going to be demanding process. This is not going to be a particulary great idea, a better approach would be to return results in pages so that we can maintain a responsive UI and reduced long running network calls.&lt;/p&gt;
&lt;p&gt;Taking this example further, we lets say that we would like our page sizes to be 5 records each. The first page will return record 1-5 and when the user clicks next we require records 6-10 to be displayed. In order for us to be able to achieve this functionality we need to implement an index on our result set so that we can locate a particular page of data within the full results. To do this SQL server provides a handy function called  which ROW_NUMBER()provides an incremental index for each record in our result set. If we implement the  ROW_NUMBER()as part of our results we can see the results below.&lt;/p&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;SELECT&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;     &lt;span style="color: fuchsia"&gt;ROW_NUMBER&lt;/span&gt;&lt;span style="color: gray"&gt;()&lt;/span&gt; &lt;span style="color: blue"&gt;OVER&lt;/span&gt; &lt;span style="color: gray"&gt;(&lt;/span&gt;&lt;span style="color: blue"&gt;ORDER&lt;/span&gt; &lt;span style="color: blue"&gt;BY&lt;/span&gt; &lt;span style="color: gray"&gt;(&lt;/span&gt;&lt;span style="color: blue"&gt;SELECT&lt;/span&gt; 1&lt;span style="color: gray"&gt;))&lt;/span&gt; &lt;span style="color: blue"&gt;as&lt;/span&gt; [Index]&lt;span style="color: gray"&gt;,&lt;/span&gt; ID&lt;span style="color: gray"&gt;,&lt;/span&gt; Forename&lt;span style="color: gray"&gt;,&lt;/span&gt; Surname&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;FROM&lt;/span&gt;         Person &lt;span style="color: blue"&gt;Where&lt;/span&gt; Surname &lt;span style="color: gray"&gt;like&lt;/span&gt; &lt;span style="color: red"&gt;'%DA%'&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p align="center"&gt;&lt;img height="391" alt="" width="449" src="http://www.ontheblog.net/CMS/Portals/0/results2.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;We can now see from executed query above that our results contain and INDEX column which uniquely identifies each row returned from our results. By adding this index to our results we now have a way of navigating batches of records within our results set.  To do this is not as simple as just adding a WHERE to our SQL statement, instead we must execute the full query in order to determine our full set of indexes, then apply the WHERE on top of that. We can doing this using a sub-query.&lt;/p&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;SELECT&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;  ID&lt;span style="color: gray"&gt;,&lt;/span&gt; Forename&lt;span style="color: gray"&gt;,&lt;/span&gt; Surname&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;FROM&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;     &lt;span style="color: gray"&gt;(&lt;/span&gt;&lt;span style="color: blue"&gt;SELECT&lt;/span&gt;  &lt;span style="color: fuchsia"&gt;ROW_NUMBER&lt;/span&gt;&lt;span style="color: gray"&gt;()&lt;/span&gt; &lt;span style="color: blue"&gt;OVER&lt;/span&gt; &lt;span style="color: gray"&gt;(&lt;/span&gt;&lt;span style="color: blue"&gt;ORDER&lt;/span&gt; &lt;span style="color: blue"&gt;BY&lt;/span&gt; &lt;span style="color: gray"&gt;(&lt;/span&gt;&lt;span style="color: blue"&gt;SELECT&lt;/span&gt; 1&lt;span style="color: gray"&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;             &lt;span style="color: blue"&gt;AS&lt;/span&gt; [Index]&lt;span style="color: gray"&gt;,&lt;/span&gt; ID&lt;span style="color: gray"&gt;,&lt;/span&gt; Forename&lt;span style="color: gray"&gt;,&lt;/span&gt; Surname &lt;span style="color: blue"&gt;From&lt;/span&gt; Person&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                   &lt;span style="color: blue"&gt;Where&lt;/span&gt; Surname &lt;span style="color: gray"&gt;like&lt;/span&gt; &lt;span style="color: red"&gt;'%DA%'&lt;/span&gt;&lt;span style="color: gray"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;AS&lt;/span&gt; ResultSet&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;WHERE&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;  [Index] &lt;span style="color: gray"&gt;&gt;=&lt;/span&gt; 6 &lt;span style="color: gray"&gt;AND&lt;/span&gt; [Index] &lt;span style="color: gray"&gt;&lt;=&lt;/span&gt; 10&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;And the results&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="400" alt="" width="443" src="http://www.ontheblog.net/CMS/Portals/0/results3.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;As you can see our results reflect only the range of records that we require from our overall result set. It’s important to note that the full query is still being executed in the background but we are reducing the burden on the results that are being sent to the client.  So I hope this provides an alternative way to managing large result sets over the internet.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/54/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/54/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=54</guid>
      <pubDate>Thu, 31 Jul 2008 17:20:11 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=54</trackback:ping>
    </item>
    <item>
      <title>Silverlight 2: Control Templating &amp; The Visual State Manager - PART 2</title>
      <description>&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;In my &lt;a href="http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/52/Default.aspx"&gt;previous post&lt;/a&gt; we took a quick look at some of the support blend offers for skinning controls in Silverlight 2. Within only a few minutes we were able to take an existing textbox control and extend its visual tree using a custom template. In this post I plan to take our previous skinned control example further by implementing some simple animations. This is a good chance to check out the new VisualStateManager which greatly simplifies the development of animations in Silverlight. &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;For the basis of this tutorial we are going to extend our textbox template so that when a users places their mouse over the textbox the control will grow to make the text more readable. When the mouse leaves the textbox control the text will shrink again back to its normal “State”. It’s the word “State” here that really matters. &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;If you are observant and you haven’t moved all your panels around in blend, you may have noticed a new panel called states on the left hand side of your IDE. The states panel is a visual interface for managing the different states your control can be in. To help make this clearer, we can take a look at the control template for a button control (See &lt;a href="http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/52/Default.aspx"&gt;previous post&lt;/a&gt; for how to do this in blend). &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;p align="center"&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;&lt;img height="528" alt="" width="323" src="http://www.ontheblog.net/CMS/Portals/0/Images/buttonStates.jpg" /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;As you can see the standard Silverlight button control has a number of visual states that it can placed into. If we click on one of these states in the designer, our design surface will reflect what the look control will be in that state. As an example below, if we click on the disabled state we can see that the button looks greyed out. &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;p align="center"&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;&lt;img height="462" alt="" width="516" src="http://www.ontheblog.net/CMS/Portals/0/Images/comparisonStates.jpg" /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;What is important about the VisualStateManager is that it allows us to focus in a design centric way what each state looks like when the state is changed. In order to manage states more effectively you can see that Blend provides State Groups in which we can hold multiple visual states. We are not concerned with how we get to a particular state, we are just focused on the final look once we reach it. Some of the magic behind the VisualStateManager will be covered later. &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;So if we move back to our previous textbox example, we specified that we want the control to increase its size when a mouse rolls over the control and when the mouse leaves, the control should return to its original size. Given this, we know that our control can be in 1 of 2 states. Using blend, we are going to create a new state group and add two states to our control. Shown below.&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;p align="center"&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;&lt;img height="237" alt="" width="339" src="http://www.ontheblog.net/CMS/Portals/0/Images/OurStates.jpg" /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;As you can see, on the state group you have the oppurtinity to specify a default duration. This duration is a default that will be applied when a control transitions from one state to another. If you like you can ignore this but for the purpose of this example we have set or default.&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;If we click on our GROW state we can see our control displayed in the designer. We are going to make a simple change to our textbox properties by setting the fontsize on the textbox to 72. This is reflected in the designer as shown below. &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;p align="center"&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;&lt;img height="250" alt="" width="400" src="http://www.ontheblog.net/CMS/Portals/0/GrowstateDesigner.jpg" /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font size="2"&gt;If we click on our NORMAL state you will see the control looks how it did before the fontsize was changed. In terms of working in the designer we are now done, we have our begin state which is our BASE state and we have our transition state which is our GROW state and our final END state will be the NORMAL state. All we need to do now is invoke the state transitions when the appropriate events are fired. Before we do this we should take a quick look at the XAML Blend has created for us.&lt;/font&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualStateGroup&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Name&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="StateGroup"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualStateGroup.Transitions&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualTransition&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Duration&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="00:00:00.5000000"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualStateGroup.Transitions&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Name&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="Grow"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 144pt"&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; BeginTime&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="00:00:00"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Duration&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="00:00:00.0010000"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="textBox"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="(Control.FontSize)"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                  &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;SplineDoubleKeyFrame&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; KeyTime&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="00:00:00"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Value&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="72"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                           &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Name&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="Normal"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualStateGroup&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font color="#000000" size="2"&gt;You can see that the XAML pretty much represents what’s in the blend designer. We have a storyboard that has been placed within our Grow State that will apply our transition. The final part of the puzzle is to hook up event handlers to our textbox’s MouseOver and MouseLeave events. We do this in the standard way, by hooking up an event handler. I usually jump to visual studio for this work as we want to auto-create the event handler.  See below.&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;       &lt;span style="color: red"&gt; MouseEnter&lt;/span&gt;&lt;span style="color: blue"&gt;="textBox_MouseEnter"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;       &lt;span style="color: red"&gt; MouseLeave&lt;/span&gt;&lt;span style="color: blue"&gt;="textBox_MouseLeave"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;font color="#000000"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; textBox_MouseEnter(&lt;/font&gt;&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;MouseEventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;   &lt;font color="#000000"&gt; {&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: #2b91af"&gt;VisualStateManager&lt;/span&gt;.GoToState(&lt;span style="color: blue"&gt;this&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Grow"&lt;/span&gt;, &lt;span style="color: blue"&gt;true&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;   &lt;font color="#000000"&gt; }&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; &lt;font color="#000000"&gt;textBox_MouseLeave&lt;/font&gt;(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;MouseEventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: #2b91af"&gt;VisualStateManager&lt;/span&gt;.GoToState(&lt;span style="color: blue"&gt;this&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Normal"&lt;/span&gt;, &lt;span style="color: blue"&gt;true&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;span style="font-size: 8pt"&gt;&lt;font color="#000000" size="2"&gt;In order to transition from one state to another the VisualStateManager class implements a static method that takes 3 arguments. The first argument is the control that we want to move form one state to another. In our case we use&lt;/font&gt; &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;this&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="font-size: 8pt"&gt;&lt;font color="#000000" size="2"&gt; as we are within our control If you want to call a state transition for a control your using it is just a matter of passing that control in instead. The second argument is the name of the state we want to move to and the final argument is a flag indicating if we want a transition effect.&lt;/font&gt; &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font color="#000000" size="2"&gt;After we have implemented our state transitions in code we are ready to go. I hope you can see how easy and powerful the VisualStateManger is and what it brings to Silverlight Apps. &lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;font color="#000000" size="2"&gt; &lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;&lt;font color="#000000" size="2"&gt;You can see an example of this code running &lt;a target="_blank" href="http://www.ontheblog.net/silversamples/vsm/Default.htm"&gt;here &lt;/a&gt;and the full source can be downloaded &lt;a href="http://www.ontheblog.net/silversamples/vsm/vsmDemo.zip"&gt;here&lt;/a&gt;.&lt;/font&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/53/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/53/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=53</guid>
      <pubDate>Mon, 28 Jul 2008 09:02:56 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=53</trackback:ping>
    </item>
    <item>
      <title>Silverlight 2: Control Templating &amp; The Visual State Manager - PART 1</title>
      <description>&lt;p&gt;In this blog I wanted to provide a simple overview of some of the features provided as part of the &lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?familyid=32A3E916-E681-4955-BC9F-CFBA49273C7C&amp;displaylang=en"&gt;June 2.5 Blend preview&lt;/a&gt;  and Silverlight 2 Beta 2.  Two of the key features that have been made available as part of this release is the ability to easily template controls in order to create your own custom skins as well as the new &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/system.windows.visualstatemanager(VS.95).aspx"&gt;Visual State Manager&lt;/a&gt; which helps aid int the development of animations.&lt;/p&gt;
&lt;p&gt;So lets get started. The first thing we want to do is have a look at how easy it is to create custom templates for controls using the June preview of Blend. We are going to create a simple Silverlight Application using the default project template provided by Blend. (Shown below)&lt;template image=""&gt;&lt;/template&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="298" alt="" width="450" src="http://www.ontheblog.net/CMS/Portals/0/VSMDemo0.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Once Blend has created our project we need to create some very simple XAML. As this example is going to be VERY simple all we need to do is drag a textbox onto our design surface. Below shows the XAML of our form once this has been done.&lt;/p&gt;
&lt;div&gt;&lt;font color="#000000" size="2"&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;UserControl&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: red"&gt;       xmlns&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt;&lt;font color="#0000ff"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/font&gt;&lt;/a&gt;"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: red"&gt;       xmlns&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;&lt;font color="#0000ff"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/font&gt;&lt;/a&gt;"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: red"&gt;       x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Class&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="VSMDemo.Page"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: red"&gt;       Width&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="640"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Height&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="480"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Name&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="LayoutRoot"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Background&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="White" &gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;TextBox&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Height&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="23"&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 72pt; text-indent: 36pt"&gt;&lt;span style="font-size: 8pt; color: red"&gt;Margin&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="139,147,159,0"&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 72pt; text-indent: 36pt"&gt;&lt;span style="font-size: 8pt; color: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="Top"&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 72pt; text-indent: 36pt"&gt;&lt;span style="font-size: 8pt; color: red"&gt;Text&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="TextBox"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; TextWrapping&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="Wrap"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;UserControl&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font color="#000000" size="2"&gt;Now that we have our basic XAML together we can start looking at the new templating support in Blend. If you select the textbox by using the document outline and right clicking you will now be presented with the following option.&lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p align="center"&gt;&lt;font color="#000000" size="2"&gt;&lt;img height="438" alt="" width="450" src="http://www.ontheblog.net/CMS/Portals/0/Images/VSMDemo1.jpg" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" size="2"&gt;Choosing the "Edit a Copy" will present you with the following dialog. Blend now offers you the choice to create a new style resource in a number of locations. For the purpose of the tutorial just take the default settings, this should create the style resource within our current document. &lt;/font&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;font color="#000000" size="2"&gt;&lt;img height="306" alt="" width="455" src="http://www.ontheblog.net/CMS/Portals/0/Images/VSMDemo2.jpg" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" size="2"&gt;Whats really cool is that Blend will automatically take you into a design mode for editing the template.&lt;/font&gt;&lt;font color="#000000" size="2"&gt;From here I made a few changes to the default template. My XAML looks like this after my changes.&lt;/font&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;font size="2"&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Key&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="TextBoxStyle1"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; TargetType&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="TextBox"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Setter&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Property&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="Template"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                           &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Setter.Value&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                  &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;ControlTemplate&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; TargetType&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="TextBox"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                         &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Name&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="RootElement"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Key&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="Normal State"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="FocusVisualElement"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="(UIElement.Opacity)"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;SplineDoubleKeyFrame&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; KeyTime&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="00:00:00"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Value&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="0"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Key&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="Focused State"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Storyboard.TargetName&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="FocusVisualElement"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Storyboard.TargetProperty&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="(UIElement.Opacity)"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;SplineDoubleKeyFrame&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; KeyTime&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="00:00:00"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Value&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="1"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Border&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; CornerRadius&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="5,5,5,5"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; BorderBrush&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="Gainsboro"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; BorderThickness&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="2,2,2,2"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                       &lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: #a31515"&gt;Border.Background&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                              &lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: #a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: red"&gt; EndPoint&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;="0.5,1"&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: red"&gt; StartPoint&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;="0.5,0"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                                     &lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: #a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: red"&gt; Color&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;="#FFF8F5F5"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                                     &lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: #a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: red"&gt; Color&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;="#FFCFE8FC"&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: red"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;="1"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                              &lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&lt;span style="font-size: 8pt; background: yellow; color: #a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                       &lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&lt;span style="font-size: 8pt; background: yellow; color: #a31515"&gt;Border.Background&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;ScrollViewer&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Padding&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="{&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;TemplateBinding&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Padding&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;}"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; &lt;span style="background: yellow"&gt;Margin&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;="3,3,3,3"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; &lt;span style="background: yellow"&gt;BorderThickness&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;="0"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Name&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="ContentElement"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                &lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&lt;span style="font-size: 8pt; background: yellow; color: #a31515"&gt;Border&lt;/span&gt;&lt;span style="font-size: 8pt; background: yellow; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Rectangle&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt;Name&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="FocusVisualElement"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; IsHitTestVisible&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="False"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Opacity&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="0"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; StrokeThickness&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="2"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; RadiusX&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="1"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; RadiusY&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="1"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Rectangle.Stroke&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; EndPoint&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="0.5,1"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; StartPoint&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="0.5,0"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Color&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="#FFA9B9C5"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="0"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Color&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="#FF668499"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="0.325"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Color&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="#FF244E6D"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="0.325"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Color&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="#FF4F7189"&lt;/span&gt;&lt;span style="font-size: 8pt; color: red"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;="1"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                       &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Rectangle.Stroke&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                                &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Rectangle&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                         &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                                  &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;ControlTemplate&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                           &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Setter.Value&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;                     &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Setter&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;              &lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&lt;span style="font-size: 8pt; color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="font-size: 8pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/font&gt;
&lt;p&gt;&lt;font size="2"&gt;The elements highlighted in yellow reflect the changes I have made to the default template. If we run our application at this point we can see what our template looks like.&lt;/font&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p align="center"&gt;&lt;font size="2"&gt;&lt;a target="_blank" href="http://www.ontheblog.net/silversamples/vsm/Default.htm"&gt;&lt;img height="139" alt="" width="252" src="http://www.ontheblog.net/CMS/Portals/0/Images/VSMDemo3.jpg" /&gt;&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;So now you can see just how easy it is to create our own control skins within Blend. In part 2 we will extend this example to show you the new VisualStateManager which greatly increases our productivity when creating cool looking animations.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;a href="http://www.ontheblog.net/CMS/Home/tabid/36/ctl/Edit_Entry/mid/376/EntryID/53/Default.aspx"&gt;Part 2&lt;/a&gt;&lt;/font&gt;&lt;span style="font-size: 10pt; color: blue"&gt; &lt;/span&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/52/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/52/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=52</guid>
      <pubDate>Thu, 24 Jul 2008 21:48:24 GMT</pubDate>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=52</trackback:ping>
    </item>
    <item>
      <title>Fluent Language Interfaces &amp; DSL's</title>
      <description>&lt;p&gt;I was having think about fluent language interfaces and got me thinking about a DSL for search. Take this example&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;Web&lt;/font&gt;.Search&lt;br /&gt;
       .Contains(&lt;font color="#ff0000"&gt;"David"&lt;/font&gt;).And.Contains(&lt;font color="#ff0000"&gt;"Hanson"&lt;/font&gt;)&lt;br /&gt;
       .Or.contains(&lt;font color="#ff0000"&gt;"Michael Smith"&lt;/font&gt;)&lt;br /&gt;
       .Exclude(&lt;font color="#ff0000"&gt;"Sex"&lt;/font&gt;)&lt;br /&gt;
       .Exclude(&lt;font color="#ff0000"&gt;"man, Word, Slipper"&lt;/font&gt;)&lt;/p&gt;
&lt;p&gt;       .WithinDomain("&lt;a href="http://www.ontheblog.net/"&gt;www.ontheBlog.Net&lt;/a&gt;")&lt;br /&gt;
       .OutPutFormat(Format.&lt;font color="#0000ff"&gt;XML&lt;/font&gt;)&lt;br /&gt;
       .Provider(&lt;font color="#0000ff"&gt;Provider.Google&lt;/font&gt; | &lt;font color="#0000ff"&gt;Provider.LiveSearch&lt;/font&gt;)&lt;br /&gt;
       .FilterLevel(&lt;font color="#0000ff"&gt;Filter.None&lt;/font&gt;)&lt;br /&gt;
       .MaxResult(&lt;font color="#ff0000"&gt;100&lt;/font&gt;)&lt;br /&gt;
       .Language(&lt;font color="#0000ff"&gt;Language.English&lt;/font&gt;)&lt;br /&gt;
       .Execute();&lt;/p&gt;
&lt;p&gt;I may have to take this further. &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/51/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/51/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=51</guid>
      <pubDate>Thu, 07 Aug 2008 22:36:04 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=51</trackback:ping>
    </item>
    <item>
      <title>RIA's and Search Engines 2.</title>
      <description>&lt;p align="center"&gt;&lt;img height="113" width="320" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/adobe.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;A while back I blogged about the the trend in web content being developed using  Rich Internet Application technolgies such as Flash &amp; Silverlight. &lt;a href="http://www.ontheblog.net/CMS/Home/tabid/36/EntryId/24/Default.aspx"&gt;Previous Blog&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Well an interesting announcement comes from Adobe which looks to address some of these issue going forward. Snippet below. Full article on business week here. &lt;a href="http://www.businessweek.com/technology/content/jul2008/tc2008071_626739.htm?chan=top+news_top+news+index_technology"&gt;Story.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;"Flash, software, Adobe, Google, Yahoo, search engine, Web, Macromedia, photos, animationIf you're trawling the Web to buy a pair of Nikes, shop for a Volkswagen, or get a glimpse of Walt Disney's Wall-E, chances are you'll end up viewing graphics built with Adobe Systems' Flash software. Good luck finding them with a search engine, though. Turns out Google and other Web-search tools can't easily recognize pages laden with Flash-created images. &lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;At least not yet. Adobe (ADBE) announced steps to solve those problems on July 1, providing Google (GOOG) and Yahoo! (YHOO) with software that will make pages inside Flash-powered sites show up higher in search results and infuse those results with more relevant details. Adobe's moves could persuade more consumers to visit its customers' sites and make Flash software more attractive to Web site developers. Adobe's agreements with the two biggest search engines on the Web is also a competitive slap at Microsoft (MSFT), which makes Web software that competes with Adobe's."&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/50/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/50/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=50</guid>
      <pubDate>Wed, 02 Jul 2008 15:35:17 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=50</trackback:ping>
    </item>
    <item>
      <title>Free Download Manager </title>
      <description>&lt;p&gt;Over the last few weeks I have been using the following product found here (&lt;a href="http://www.freedownloadmanager.org/features.htm"&gt;http://www.freedownloadmanager.org/features.htm&lt;/a&gt;) which provides some cool features for downloading. Since using it I am starting to get the most of out of my 20mbps cable connection. The reason is due to the fact that the when downloading, the software creates multiple HTTP connections to the file. Check this download speed for the Silverlight 2 Beta 2 tools. Awesome.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="342" alt="" width="488" src="http://www.ontheblog.net/CMS/Portals/0/Images/downloadSpeed.jpg" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;Great speed for downloads&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Key features&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Multiple HTTP connections for a single download (Make downloading ALOT faster)&lt;/li&gt;
    &lt;li&gt;Automatically resumes on broken connections&lt;/li&gt;
    &lt;li&gt;Torrent support&lt;/li&gt;
    &lt;li&gt;Media Previews for partially downloaded files&lt;/li&gt;
    &lt;li&gt;Download only certain files held in a zip file.&lt;/li&gt;
    &lt;li&gt;Download entire sites&lt;/li&gt;
&lt;/ul&gt;
&lt;p align="center"&gt;&lt;img height="427" alt="" width="571" src="http://www.ontheblog.net/CMS/Portals/0/Images/frdmscreenshot.jpg" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;Screen shot&lt;/strong&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/49/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/49/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=49</guid>
      <pubDate>Sat, 21 Jun 2008 11:35:45 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=49</trackback:ping>
    </item>
    <item>
      <title>Cross-Platform DRM Support for Silverlight 2 Beta 2</title>
      <description>&lt;p align="center"&gt;&lt;img height="375" alt="" width="334" src="http://www.ontheblog.net/CMS/Portals/0/Images/silverlightDRM.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;I was having a read through of the feature set for &lt;a target="_blank" href="http://silverlight.net/GetStarted/"&gt;Silverlight 2 Beta 2&lt;/a&gt;. One of the items that instantly stood out for me was the fact that with Beta 2 Support for &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Digital_rights_management"&gt;DRM&lt;/a&gt; (Digital Rights Management) has made it, and more importantly...........IT’S CROSS BROWSER AND CROSS PLATFORM! Now let me be clear on this, I am not a fan of DRM as I believe as a consumer I have the right to use the content I have paid for in anyway I choose. I’m not suggesting copying and passing on too friends is &lt;a target="_blank" href="http://en.wikipedia.org/wiki/FairPlay_%28DRM%29"&gt;fairplay&lt;/a&gt; but I do feel I should be able to duplicate the media for all the devices in my home. That said, although I am not a fan of DRM personally, I can greet this news with optimism and here is why.&lt;/p&gt;
&lt;p&gt;About 18 months ago I was working on a contract for &lt;a target="_blank" href="http://w1.siemens.com/entry/uk/en/"&gt;Siemens&lt;/a&gt; who were developing the packaging and delivery of the &lt;a target="_blank" href="http://www.bbc.co.uk/iplayer/"&gt;BBC IPlayers&lt;/a&gt; content. This was interesting work and really opened my eyes to the amount of effort that must go into launching a platform like the IPlayer. 18 months ago none of us working on the project had any idea as to how successful the IPlayer would be, therefore the application was built with performance and scalability in mind. A good thing too given the way it panned out.&lt;/p&gt;
&lt;p&gt;While working on the project, one area I felt was seriously lacking was the cross platform support. All content delivered via the &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Video_on_demand"&gt;VOD&lt;/a&gt; system is encrypted using Windows DRM. As the name suggest, the result that decision was that all content inevitably becomes locked into the windows platform. Therefore unless you’re on a windows platform, the IPlayer would be useless to you.&lt;/p&gt;
&lt;p&gt;The BBC were not the only ones to adopt this approach, SKY, ITV and Channel 4 have all built their VOD platforms on the &lt;a target="_blank" href="http://www.kontiki.com/"&gt;Kontiki P2P&lt;/a&gt; system using Windows DRM. So as a guy with a Mac (Yes I run windows vista on it) I could consider myself up shits creek! So the question is, why is this good news? It’s good news as whether we like it or not DRM is essential for large media conglomerate when it comes to delivering their content over the web. Whether we like it or not, I still cannot see them dropping it due to public demand. Therefore, with Silverlight providing the tools necessasary for cross-platform DRM, adaptable streaming and the ability to generate amazing &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Rich_Internet_application"&gt;RIA’s&lt;/a&gt; there are very little hurdles left to overcome.&lt;/p&gt;
&lt;p&gt;I expect to see the BBC move this way as they have previously confirmed that Mac support was on their todo list. Also some of the demo’s from MIX07 with the &lt;a target="_blank" href="http://www.pcpro.co.uk/news/112009/bbc-prototypes-web-20-for-radio-1.html"&gt;BBC Radio 1 site&lt;/a&gt; delivered via Silverlight show the potential. I am hoping to have a play with the new Silverlight 2 Beta 2 features in the next few weeks so expect some posts then.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/48/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/48/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=48</guid>
      <pubDate>Sun, 08 Jun 2008 16:32:14 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=48</trackback:ping>
    </item>
    <item>
      <title>Isle of Wight Festival and my technology addiction! </title>
      <description>&lt;p align="center"&gt;&lt;img height="250" alt="" width="302" src="http://www.ontheblog.net/CMS/Portals/0/Images/IOW.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;I'm off to the Isle of Wight festival this week and as usual I have spent the weekend getting all the essentials together. I've got my tent dusted down, wellies, wet wipes beer and much more ready to go. However I am starting to think that I am a little to addicted. Here is a rundown of the gadgets i'm taking.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;IPod Touch&lt;/li&gt;
    &lt;li&gt;ITrip&lt;/li&gt;
    &lt;li&gt;Stereo to transmit music from IPod too.&lt;/li&gt;
    &lt;li&gt;Solar Charger&lt;/li&gt;
    &lt;li&gt;Camera&lt;/li&gt;
    &lt;li&gt;Mobile Phone&lt;/li&gt;
    &lt;li&gt;Walkie Talkes&lt;/li&gt;
    &lt;li&gt;Windup torch&lt;/li&gt;
    &lt;li&gt;Smartphone&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Something tells me I may need to lock my tent up!&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/47/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/47/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=47</guid>
      <pubDate>Sat, 07 Jun 2008 17:37:29 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=47</trackback:ping>
    </item>
    <item>
      <title>The power of Silverlight vectors</title>
      <description>&lt;p&gt;As you probably know the power of WPF and its subset Silverlight is its ability to render images using &lt;a href="http://en.wikipedia.org/wiki/Vector_graphics"&gt;vector graphics&lt;/a&gt;. I am not a graphic designer myself, I can usually get a decent design together but it’s usually more evolutionary rather than revolutionary.&lt;/p&gt;
&lt;p&gt;As all images in vector graphics are expressed using mathematics they provide computers with some superior processing capabilities that are not possible with common binary formats. We can transform them, scale them, animate them to name just a few . However, with the advantages of having an image represented in mathematics, we also suffer with increased complexity when trying to create them from scratch.&lt;/p&gt;
&lt;p&gt;With the current release of Silverlight, we have the power in the framework to represent near photo realistic images purely in vectors. Take for example the photo of me  shown below, this image, running in Silverlight, has been built using only vectors. You can see this running in Silverlight &lt;a target="_blank" href="http://www.ontheblog.net/samples/VectorMe/TestPage.Html"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p align="center"&gt;&lt;a target="_blank" href="http://www.ontheblog.net/samples/VectorMe/TestPage.Html"&gt;&lt;img height="409" alt="" width="462" src="http://www.ontheblog.net/CMS/Portals/0/Images/vectorMe.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;Bad Mood &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/regular_smile.gif" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If we take a closer look at the structure of the eye, we can see that the complexity of the XAML path objects, which are the basic building blocks used to compose the image, are far beyond the capabilities of any human designer using tools such as Blend or Visual Studio.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="330" alt="" width="470" src="http://www.ontheblog.net/CMS/Portals/0/Images/eyevector.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The image was actually constructed using the cool site  &lt;a target="_blank" href="http://vectormagic.com/"&gt;vectormagic.com&lt;/a&gt;. On this site you can upload any photo and it will convert the image to vectors. This covered off the majority of the grunt work of converting the image into vectors.  VectorMagic offer you two free downloads in a range of formats.... but no XAML option. Therefore, I downloaded the file in Adobe Illustrator format, from there it was a simple process of exporting the image into XAML using Mike Swanson’s awesome &lt;a target="_blank" href="http://www.mikeswanson.com/xamlexport/"&gt;AI-XAML converter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Hope this quick example has helped illustrate the power of Silverlight’s graphical capabilities and gets you thinking about what other assets you could convert into XAML.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/46/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/46/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=46</guid>
      <pubDate>Fri, 23 May 2008 10:58:53 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=46</trackback:ping>
    </item>
    <item>
      <title>.NET 3.5 SP1 &amp; Visual Studio 2008 SP1 Beta released</title>
      <description>&lt;div&gt;
&lt;p align="center"&gt;&lt;img height="75" alt="" width="250" src="http://www.ontheblog.net/CMS/Portals/0/Images/studio2008.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;It seems .Net 3.5 SP1 and Visual Studio 2008 SP1 beta are now available from Microsoft for download. This release brings a number of fixes for hundreds of bugs that have been reported by customers.&lt;/p&gt;
&lt;div&gt;This download installs Visual Studio 2008 SP1 Beta. Visual Studio 2008 SP1 includes support for SQL Server 2008, new ADO.NET features such as the Entity Framework, improvements to the WPF designers, WCF templates for Silverlight projects, debugger support for the .NET Framework public symbols and source release, control improvements such as the DataRepeater for Windows Forms and Office 2007 Ribbons for C++, and several general updates for debugging and IntelliSense. SP1 also enhances the stability, performance, and security of many features.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The included .NET Framework 3.5 Service Pack 1 adds many new features and fixes, including the following:&lt;/div&gt;
&lt;div&gt;.NET Framework Client Release (“Arrowhead”)&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;ASP.NET Dynamic Data&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;ASP.NET Routing&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;ADO.NET Data Services&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;ADO.NET Entity Framework&lt;/div&gt;
&lt;p&gt;I’m just hoping that it resolves the constant OutOfMemory exceptions I get when working with the WPF designer. You can find the downloads here.&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/vstudio/cc533448.aspx"&gt;http://msdn.microsoft.com/en-us/vstudio/cc533448.aspx&lt;/a&gt;&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/45/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/45/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=45</guid>
      <pubDate>Tue, 13 May 2008 08:31:57 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=45</trackback:ping>
    </item>
    <item>
      <title>Oldest running code?</title>
      <description>&lt;div&gt;
&lt;p align="center"&gt;&lt;img height="469" alt="" width="504" src="http://www.ontheblog.net/CMS/Portals/0/Images/DifferenceEngine.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Slashdot poses an interesting &lt;a href="http://developers.slashdot.org/article.pl?no_d2=1&amp;sid=08/05/11/1759213"&gt;question&lt;/a&gt; asking what is the oldest code still running today. Of the 600+ comments so far I have cherry picked a few that I thought were good choices.&lt;/p&gt;
&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;The software on the &lt;a href="http://en.wikipedia.org/wiki/Voyager_1"&gt;Voyager&lt;/a&gt; and Pioneer SpaceCraft 1977&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Digital watches&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Heavy machinery used from the late 50’s&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Babbage &lt;a href="http://en.wikipedia.org/wiki/Difference_engine"&gt;Difference Engine&lt;/a&gt; (Currently running in the science museum London)&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;Worryingly – Air Traffic controls system code from the 60’s&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt; text-indent: -18pt"&gt;&lt;span&gt;·&lt;span style="font: 7pt 'Times New Roman'"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/DNA"&gt;DNA&lt;/a&gt; – At least 2 billion years old! &lt;span&gt;J&lt;/span&gt;&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div&gt;But my personal favourite!&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt; &lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;1 "Let there be light"&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;2 create universe()&lt;/div&gt;
&lt;div style="margin: 0cm 0cm 0pt 36pt"&gt;3 while (1)&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/44/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/44/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=44</guid>
      <pubDate>Mon, 12 May 2008 09:08:03 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=44</trackback:ping>
    </item>
    <item>
      <title>Cosmic Crashes</title>
      <description>&lt;div&gt;
&lt;p align="center"&gt;&lt;img height="286" width="300" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/atomic_particlesmall.jpg" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 8pt"&gt;I was catching up on some podcasts during my drive to work recently and came across an interesting topic on the &lt;a target="_blank" href="http://www.bbc.co.uk/radio/podcasts/digitalp/"&gt;BBC's Digital Planet&lt;/a&gt; podcast. The discussion was regarding the “impact” &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Cosmic_ray"&gt;cosmic rays&lt;/a&gt; can have on our desktop computers and more importantly very expensive grid platforms such as &lt;a target="_blank" href="http://domino.research.ibm.com/comm/research_projects.nsf/pages/bluegene.index.html"&gt;IBM’s Blue Gene&lt;/a&gt;. Computer crashes can be annoyng to the average user but on grid platforms running simulations that require accurate data they can be very costly. During the podcast they had interviewed with an Intel researcher (who's name I have forgotten sorry) who was discussing his strategies for counter acting the effects these highly energetic particles can have.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;Before I outline his proposal it’s probably worth explaining some rudimentary physics. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 8pt"&gt;What is a cosmic ray? &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 8pt"&gt;Answer:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8pt"&gt; A cosmic ray is a particle with mass greater than zero that has been been accelerated to a speed that is approaching the &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Speed_of_light"&gt;speed of light&lt;/a&gt;. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 8pt"&gt;How does it get that fast? &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 8pt"&gt;Answer&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8pt"&gt;: A range of cosmic events can cause this but let’s just say for this blog, a star exploded millions of years ago and that it is this explosion that caused the cosmic ray. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 8pt"&gt;I heard that most cosmic rays just pass right through us.. How come? &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 8pt"&gt;Answer:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8pt"&gt; Well thanks to &lt;a href="http://en.wikipedia.org/wiki/Albert_einstein"&gt;Mr Einstein&lt;/a&gt; we know that with increased mass comes an exponential increase in energy in order to accelerate the matter towards light speed. Therefore cosmic rays are generally low is mass. As a result, they can pass through the atoms in your body undisturbed. (Well mostly)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 8pt"&gt;So how do cosmic rays cause computer crashes?&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 8pt"&gt;Answer:&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size: 8pt"&gt; Computers processors are based on logic gates which manage the flow of electrons on the processor. When a cosmic ray hits the processor a surge or peak of energy is releases in the form of electrons which can result in the processor providing inaccurate results. (Hence it crashes).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt;So with the details out of the way I can get on to explaining what the Intel researcher was planning to in order to resolve this problem. Basically, his view on cosmic crashes was that it’s going to be almost impossible to stop them from happening,  insulating the processor with cosmic ray impenetrable materials is going to be very hard, very large and expensive. So, instead he proposed that what we should do is build detectors which can identify the surge of electrons associated with a cosmic ray and then instruct the processor to rerun the previous calculation that may have been affected.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 8pt"&gt; I must say... I like his thinking.&lt;/span&gt;&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/43/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/43/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=43</guid>
      <pubDate>Tue, 29 Apr 2008 19:51:56 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=43</trackback:ping>
    </item>
    <item>
      <title>LINQ to Reflection Part 3: Updating Fields </title>
      <description>&lt;div&gt;In &lt;a href="http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/41/Default.aspx"&gt;part 2&lt;/a&gt; of this LINQ 2 Reflection series I took you through how we go about querying fields that may existing within an object graph. Before we proceed, it’s important to remember that a call to object.Field&lt;T&gt; will return an instance of type Linq.Reflection.Field. As part 2 focused purely the reading fields it’s about time we take a look at how we can go about updating them. If we look at the intellisense that Visual Studio provides for the Field&lt;T&gt; class we can see that this class has an Update&lt;T&gt; method. Shown below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;img height="221" width="673" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/updatefieldintelli.jpg" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Firstly, as the Update&lt;T&gt; method is contextual, there is no requirement to pass the name of the field we wish to update as this can be inferred from its parent. Secondly, As the Field&lt;T&gt; returns a &lt;a href="http://msdn2.microsoft.com/en-us/library/sz6zd40f(VS.80).aspx"&gt;generic class&lt;/a&gt; of type T it also allows us to infer the Type of value we wish to update. Below is a simple update statement on a person entity.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;person&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    .Field&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_firstName"&lt;/span&gt;).Update(&lt;span style="color: #a31515"&gt;"James"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    .Field&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_lastName"&lt;/span&gt;).Update(&lt;span style="color: #a31515"&gt;"Brown"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    .Field&lt;&lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_dateOfBirth"&lt;/span&gt;).Update(DOB);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The Update&lt;T&gt; method of the Field&lt;T&gt; class returns an instance of the parent object we are currently working with. Internally the Field&lt;T&gt; class passes the parent context down our chained methods. Therefore we have the ability to move up the object graph if so desired. In this situation, where we are updating 1 of many fields on the parent context, its important that the return value from Update&lt;T&gt; is that of the parent object.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;p&gt;As that’s pretty much it for updating fields using LINQ to Reflection. You can call the Update&lt;T&gt; on and Field&lt;T&gt; or Property&lt;T&gt; accessor. As this point in our series you have the information you need to drill down any object reading and writing property/field values to suit your tests scenarios.  &lt;/p&gt;
&lt;p&gt;In part 4 we will start looking at how we can leverage the power of these extensions methods by showing how we can &lt;a href="http://en.wikipedia.org/wiki/Mock_object"&gt;mock&lt;/a&gt; internal objects without breaking the rules of encapsulation.&lt;/p&gt;
&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/42/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/42/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=42</guid>
      <pubDate>Mon, 28 Apr 2008 13:30:07 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=42</trackback:ping>
    </item>
    <item>
      <title>LINQ to Reflection Part 2: Reading Fields</title>
      <description>&lt;div&gt;In &lt;a href="http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/38/Default.aspx"&gt;part 1&lt;/a&gt; of my LINQ to Reflection series I outlined some of the key drivers behind me creating a set of extension methods that can be used to query any CLR type. I also outlined that I am looking to extend this further with support for reading/writing of data, mocking, invocation, interception and other useful behaviours.  This post is purely focused on the reading of field data using the LINQ to Reflection extension methods.  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Before we get into the details of how we query data, we first need to create some tests data that will be used for each sample. Below is a method that is used to build object graph that is comprised simple and complex types with multiple child objects.  &lt;strong&gt;Note: We are already starting to use our LINQ to Reflection methods in order to create tests data. &lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Sets up an object graph for our different test scenarios.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; GetTestData()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; person = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; FillPerson(person,3, 4);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Fills the person with test data.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;param name="person"&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The person.&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;/param&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;param name="levelsDeep"&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The levels deep we wish to populate.&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;/param&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;returns&gt;&lt;/span&gt;&lt;span style="color: green"&gt;A person instance&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;/returns&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; FillPerson(&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; person,&lt;span style="color: blue"&gt;int&lt;/span&gt; noOfChildren, &lt;span style="color: blue"&gt;int&lt;/span&gt; levelsDeep)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Update our name.&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="background: yellow"&gt;person&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="background: yellow"&gt;.Field&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_firstName"&lt;/span&gt;).Update(&lt;span style="color: #a31515"&gt;"Joe"&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="background: yellow"&gt;.Field&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_lastName"&lt;/span&gt;).Update(&lt;span style="color: #a31515"&gt;"Blog "&lt;/span&gt; + levelsDeep.ToString());&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                     &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Add a Partner&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; partner = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            partner.Partner = person;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            person.Partner = partner;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//We have reached or level.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (levelsDeep == 0)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;return&lt;/span&gt; person;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: green"&gt;//Lets create the children for this person.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;int&lt;/span&gt; i = 0; i &lt; noOfChildren; i++)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                    &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; child = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                    &lt;span style="color: green"&gt;//Add children.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                    person.Children.Add(FillPerson(child, 4, levelsDeep - 1));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; person;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The result of this method is a person being created with children, grandchildren, great grandchildren and great great grandchildren. Each generation will have a lower number appended to their name. Therefore a 4 equates to the oldest and 0 equates to the youngest. This is shown in the locals window below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div align="center"&gt;&lt;img height="475" alt="" width="493" src="http://www.ontheblog.net/CMS/Portals/0/Images/objectgraphPerson.jpg" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now that we have some tests data to work with it’s about time we starting looking at some LINQ to Reflection samples. As mentioned in part 1, LINQ to Reflection provides extension methods for the Object type. This therefore means, if you import the LINQ.Reflection namespace, every single CLR type in scope is queryable. This includes base types such as string, int, decimal, object &amp; any other type. Below is a an example of the intellisense being displayed on a string class once the LINQ.Reflection namespace has been imported.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;img height="310" alt="" width="692" src="http://www.ontheblog.net/CMS/Portals/0/Images/intellisense1.jpg" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Having the extension methods available on all .net types &amp; at any point is one of the features I consider the most compelling. You will also notices that the extension methods use .NET generics, this is vitally important as I felt type safety and intellisense support is invaluable when you are digging many levels deep into an object graph.  I am hoping as we start to delve deeper you start to see the benefits of these decisions.  &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Sample 1 – Reading Fields from an instance.&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;string&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; firstName = person.Field&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_firstName"&lt;/span&gt;).Value;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;DateTime&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; DOB = person.Field&lt;&lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_dateOfBirth"&lt;/span&gt;).Value;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;Console&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"First Name: {0} - Year Born: {1}"&lt;/span&gt;, firstName, DOB.Year);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This example shows how we can read fields held on an instanced type [Person]. FYI these fields are private. LINQ to Reflection allows you to read fields on any type whether private, protected, internal &amp; public. In order to read a field we use the &lt;strong&gt;Field&lt;T&lt;/strong&gt;&gt; extension method.  We pass the type argument to the Field method in order to strongly type the value we are going to be accessing &lt;span style="font-size: 10pt"&gt;person.Field&lt;&lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;&gt;&lt;/span&gt;. Next we need to pass the name of the field we are trying to access, we do this using the name parameter (&lt;span style="font-size: 10pt; color: #a31515"&gt;"_dateOfBirth"&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;).&lt;/span&gt;The final part is to call the Value property which will return a strongly typed value from the field. The result of running this code is shown below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;First Name: Joe - Year Born: 1978&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Sample 2 – Reading complex fields from an instance.&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;In the previous example we are accessing fields on our person instance using fairly simple types. However, the Field&lt;T&gt; method allows us to use generics therefore we can pass any type we desire into the type argument. Often fields that sit within an object are complex in nature, they maybe other entities, collections or connections etc. This example shows the Field&lt;T&gt; method being called in order to return a strongly typed collection of persons &lt;span style="font-size: 10pt"&gt;.Field&lt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&gt;&gt;&lt;/span&gt;.  We then iterate around this collection writing out each person’s name and age.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;List&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;&lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&gt; children = person.Field&lt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&gt;&gt;(&lt;span style="color: #a31515"&gt;"_children"&lt;/span&gt;).Value;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;foreach&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;(&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; child &lt;span style="color: blue"&gt;in&lt;/span&gt; children)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;     &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"First Name: {0} - Year Born: {1}"&lt;/span&gt;, person.Name, person.Age);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The output from this code is shown below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;First Name: Joe Blog 4 - Age: 29&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;First Name: Joe Blog 4 - Age: 29&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;First Name: Joe Blog 4 - Age: 29&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Sample 3 – Reading a field where the type is inaccessibly.&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;At this point you may be wondering what you do in the situation whereby you do not know the type of the field. In these situations you can down cast the field to its lowest common denominator for example a custom collection could be converted to a List&lt;T&gt; or an entity could be downcast to an object. Below is an example of accessing a field that you do not know the type of.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;person.Field&lt;&lt;span style="color: #2b91af"&gt;Object&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_dateOfBirth"&lt;/span&gt;).Value;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Sample 4 – Obtaining a list of available fields.&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;During testing of your own objects you often know what internal fields are being used. Therefore obtaining the name is not an issue. However, some types you wont and therefore you need a way to interrogate the object in order to determine the field name. The Fields extension method provides this functionality.  It returns a collection of Linq.Reflection.Field objects which can be used to read values or alternatively drill down deeper. Below is an example of reading all fields on the string class.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;foreach&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; (&lt;span style="color: #2b91af"&gt;Field&lt;/span&gt;&lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&gt; field &lt;span style="color: blue"&gt;in&lt;/span&gt; &lt;span style="color: #a31515"&gt;"hello"&lt;/span&gt; Fields())&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Field Name: {0}"&lt;/span&gt;, field.Name);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;And the result of running this code is shown below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: m_arrayLength&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: m_stringLength&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: m_firstChar&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: Empty&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: WhitespaceChars&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: TrimHead&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: TrimTail&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: TrimBoth&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: charPtrAlignConst&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Field Name: alignConst&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Sample 5 – Finding a field with LINQ to Reflection and LINQ to Objects.&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;This example shows how we can use our LINQ to reflection extension methods to obtain a list of Fields and then perform a LINQ query on our collection in order to find a specific field.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;IEnumerable&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;&lt;&lt;span style="color: #2b91af"&gt;Field&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Object&lt;/span&gt;&gt;&gt; fields = &lt;span style="color: #a31515"&gt;"Hello"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                                        .Fields()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                                        .Where(field =&gt; field.Name == &lt;span style="color: #a31515"&gt;"alignConst"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;foreach&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; (&lt;span style="color: #2b91af"&gt;Field&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Object&lt;/span&gt;&gt; f &lt;span style="color: blue"&gt;in&lt;/span&gt; fields)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(f.Name);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The output from this code is shown below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;alignConst&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Sample 6 – Reading fields from deep inside our object graph. &lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now that you have seen how we can access fields on our top level object we will now look at how we can drill down into our object graph. As the Field&lt;T&gt; extension method returns a representation of a Field and that we can access the value of that field using the Value property, we can continue to dig deeper. Below is an example that well drill down each of the children collections that hangs of a person until we read the bottom.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;Person&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; greatGreatGrandson = person&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                            .Field&lt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&gt;&gt;(&lt;span style="color: #a31515"&gt;"_children"&lt;/span&gt;).Value[0]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                                .Field&lt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&gt;&gt;(&lt;span style="color: #a31515"&gt;"_children"&lt;/span&gt;).Value[0]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                                    .Field&lt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&gt;&gt;(&lt;span style="color: #a31515"&gt;"_children"&lt;/span&gt;).Value[0]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                                        .Field&lt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&gt;&gt;(&lt;span style="color: #a31515"&gt;"_children"&lt;/span&gt;).Value[0];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;Console&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Great great grandson : {0}"&lt;/span&gt;, greatGreatGrandson.Name);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The chaining of Field&lt;T&gt; methods allows us to step down the tree each step returning a strongly typed person collection. You can see this as we access the indexer on the collection. [0].. If we run this code we get the following result. The “Joe Blog 0” represents the last generation in our tree. Note... if we were to chain another Field method we would hit a null reference exception.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="background: yellow"&gt;Great great grandson : Joe Blog 0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So that completes Part 2 of this blog series. From this you should be able to grasp the way that field data can be read from any type of object. Further, you can see how the power of chaining allows us to writing code that represents visually what we are trying to attain. You will see this pattern repeated later on when we look at property data, method and constants. In Part 3 however we will look at how we can perform updates on data by extending these samples.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;  &lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/41/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/41/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=41</guid>
      <pubDate>Fri, 25 Apr 2008 11:34:23 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=41</trackback:ping>
    </item>
    <item>
      <title>WPF: Could not create an instance of type '{0}'</title>
      <description>&lt;p&gt;If you get this error in your designer when working with XAML in Visual Studio 2008...make sure you dont have any visual elements that inherit from an abstract class.  May seem obvious but can be easily missed. &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/wink_smile.gif" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Could not create an instance of type '{0}'&lt;/strong&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/40/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/40/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=40</guid>
      <pubDate>Fri, 25 Apr 2008 09:10:57 GMT</pubDate>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=40</trackback:ping>
    </item>
    <item>
      <title>The rise and fall of social networks</title>
      <description>&lt;p&gt;It seems every six months a new social network is on the scene. If I was to guess who currently reigns supreme I would imagine facebook is likely to be in there. Google trends provides us with some insights into this question.&lt;/p&gt;
&lt;p&gt;&lt;img height="288" width="600" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/socialNetworking.jpg" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;&lt;font color="#3366ff"&gt;facebook&lt;/font&gt;, &lt;font color="#ff0000"&gt;myspace&lt;/font&gt; &amp; &lt;font color="#ff9900"&gt;bebo&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p align="left"&gt;I will run this graph in a year and see how its changed. Until then make your own minds up.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/39/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/39/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=39</guid>
      <pubDate>Wed, 23 Apr 2008 19:47:05 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=39</trackback:ping>
    </item>
    <item>
      <title>Linq to Reflection: Part 1</title>
      <description>&lt;p&gt;Firstly.... before you read this, I would really like feedback on this series of posts and the ideas it outlines. I wanted to get that request made on the first line as apparently most humans skip the next paragraph when searching for info. So with that out of the way I will outline what this post is really about.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="319" alt="" width="418" src="http://www.ontheblog.net/CMS/Portals/0/Images/linqreflect.jpg" /&gt;&lt;/p&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;These posts are the result of a bit of a mishmash of ideas that I have been thinking about of late. The project I am currently working is fully &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Agile_software_development"&gt;agile&lt;/a&gt;, therefore &lt;a href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;test driven development&lt;/a&gt; plays a key role in the day to day work a developer encounters. We perform &lt;a href="http://en.wikipedia.org/wiki/Integration_testing"&gt;integration testing&lt;/a&gt;, interaction testing, &lt;a href="http://en.wikipedia.org/wiki/Unit_test"&gt;unit testing&lt;/a&gt; &amp; business testing as well as a few other kinds of testing during the course of writing functionality. The project has also recently migrated.NET 3.5 and a result we have started to take advantage of some of the languages features such as &lt;a href="http://en.wikipedia.org/wiki/Language_Integrated_Query"&gt;LINQ.&lt;/a&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;When I first heard of LINQ I must admit I was sceptical. I am one of those developers who likes to have a thorough understanding of the architecture prior to implementing it my code base. (Remember VB web classes anyone).  I picked up the Pro-LINQ &lt;a target="_blank" href="http://www.amazon.com/Pro-LINQ-Language-Integrated-Query/dp/1590597893"&gt;book&lt;/a&gt; from Apress a while back and spent a weekend reading from cover to cover. So before I continue I will clarify my position on these technologies.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;font style="background-color: #ffff00"&gt;&lt;strong&gt;LINQ to Objects is superb.&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color: #ffff00"&gt;&lt;strong&gt;LINQ to XML is just as good.&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color: #ffff00"&gt;&lt;strong&gt;LINQ to SQL is good but not there yet! (Release 3 Perhaps).&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font style="background-color: #ffff00"&gt;&lt;strong&gt;LINQ to Entities (Barge pole and touch come to mind).&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So with  that said I will try and move onto the focus of these posts. LINQ to Objects has been implemented using .NET 3.5 &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Extension_method"&gt;extension methods&lt;/a&gt;. Extension methods allow you to implement instance type methods on existing classes. Even if these classes are sealed or you do not have the source code so you can extend them. So given this new feature it got me thinking about what possible uses there are for extension methods.  LINQ uses them primarily on types of IEnumerable&lt;t&gt;&lt;/t&gt; in order to implement query expressions, but I wanted to see if I could use them in a more generic fashion on any type of object.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;As I felt I had a solution looking for a problem, I decided to bide my time and wait for the problem to present itself. A couple of weeks ago it did!! As said, we are working on a project which has adopted TDD. One of the issue I find with TDD is that I kept feeling I had to break encapsulation principles in order to increase testability. An internal field on a class would need to be set for a specific test condition to pass or an object deep down in my object graph would need to be configured or mocked in order to allow testing. IOC &amp; dependency injection admittedly can help in this area but are not always the simplest of solutions.  So end game is that I want to avoid this wherever possible.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Currently, In order to solve some of these problems, our project has a number of utility classes for accessing private members on a reference types. This only goes so far and can be cumbersome to use. What I would ideally like in my tool kit is the ability to seamlessly drill down an object graph using a familiar syntax. More than that, I want to be able to instantly convert those fields or properties to mock objects prior to running my tests.  I want to be able to swap mock frameworks without changing my tests and think more about my test conditions instead of the mocking framework. I want a repeatable pattern.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;As a result of this I have started work on a library which will provide a simple LINQ 2 &lt;a href="http://en.wikipedia.org/wiki/Reflection_%28computer_science%29"&gt;Reflection&lt;/a&gt; style syntax which will provide facilities for drilling down into any CLR type and performing a number of tasks ranging from (Reading data, Writing data , &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Mock_object"&gt;Mocking&lt;/a&gt; , Invocation, monitoring, interception and many other extensible behaviours.).&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;In part 2 I will start to outline some simple uses of these LINQ to reflection extension methods. For the timing being here is a &lt;strong&gt;&lt;u&gt;very simple&lt;/u&gt;&lt;/strong&gt; update statement using the extension methods on a person entity.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt; DOB = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;(1950, 1, 1);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Lets perform an Update on our entity.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            person&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                .Field&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_firstName"&lt;/span&gt;).Update(&lt;span style="color: #a31515"&gt;"James"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                .Field&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_lastName"&lt;/span&gt;).Update(&lt;span style="color: #a31515"&gt;"Brown"&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                .Field&lt;&lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;&gt;(&lt;span style="color: #a31515"&gt;"_dateOfBirth"&lt;/span&gt;).Update(DOB);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/38/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/38/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=38</guid>
      <pubDate>Wed, 23 Apr 2008 09:25:08 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=38</trackback:ping>
    </item>
    <item>
      <title>WPF: How to stretch columns in a ListView</title>
      <description>&lt;div&gt;&lt;span style="font-size: 9pt"&gt;The ListView control in WPF is a powerful option when trying to present tabular data to users. It supports many of the common behaviours found in grid controls as well as the full WFP templating architecture we have all come to love. Below is a simple of example of a ListView which has been bound to a collection of strings. The example uses a template GridVewColumn and a 3 standard GridViewColumn’s to display the data.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;p align="center"&gt;&lt;img height="278" alt="" width="535" src="http://www.ontheblog.net/CMS/Portals/0/Images/lvstd.jpg" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;And here is the associated XAML.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Window&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt;Class&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="WPFSamples.ListViewDemo"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;   &lt;span style="color: red"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;   &lt;span style="color: red"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;   &lt;span style="color: red"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;s&lt;/span&gt;&lt;span style="color: blue"&gt;="clr-namespace:System;assembly=mscorlib"&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;   &lt;span style="color: red"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Extensions&lt;/span&gt;&lt;span style="color: blue"&gt;="clr-namespace:Demo.Extension.Properties"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;   &lt;span style="color: red"&gt; Title&lt;/span&gt;&lt;span style="color: blue"&gt;="ListViewDemo"&lt;/span&gt;&lt;span style="color: red"&gt; Height&lt;/span&gt;&lt;span style="color: blue"&gt;="353"&lt;/span&gt;&lt;span style="color: red"&gt; Width&lt;/span&gt;&lt;span style="color: blue"&gt;="714"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;            &lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;&lt;!-- Some test data --&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;            &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;x&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Array&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; Type&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="{&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;x&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Type&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;}"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; x&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt;Key&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="ourData"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Scott Gu&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Tim Sneath&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Rockford Lhotka&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Robert Scoble&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Ayende Rahien&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;s&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;String&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;            &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;x&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Array&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;&lt;!-- Out ListView --&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; Name&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="myListView"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                 &lt;span style="color: red"&gt; Background&lt;/span&gt;&lt;span style="color: blue"&gt;="LightBlue"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                 &lt;span style="color: red"&gt; ItemsSource&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="color: red"&gt; ourData&lt;/span&gt;&lt;span style="color: blue"&gt;}"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;            &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;ListView.View&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridView&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                    &lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;&lt;!-- Custom template--&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; Header&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="Names" &gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn.CellTemplate&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                            &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Border&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                                    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; Text&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="{&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt; .}"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                                              &lt;span style="color: red"&gt; Foreground&lt;/span&gt;&lt;span style="color: blue"&gt;="Black"&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                                              &lt;span style="color: red"&gt; FontWeight&lt;/span&gt;&lt;span style="color: blue"&gt;="Bold" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Border&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                            &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn.CellTemplate&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                    &lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;&lt;!-- Standard columna--&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                    &lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: red"&gt; Header&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="Length"&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 10pt"&gt;                                   &lt;span style="color: red"&gt; &lt;span style="background: yellow"&gt;Width&lt;/span&gt;&lt;/span&gt;&lt;span style="background: yellow; color: blue"&gt;="50"&lt;/span&gt; &lt;span style="color: red"&gt; DisplayMemberBinding&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; Length&lt;/span&gt;&lt;span style="color: blue"&gt;}" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; Header&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="Names"&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: red"&gt; DisplayMemberBinding&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: blue"&gt;}" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                    &lt;/span&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: red"&gt; Header&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="Length"&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 10pt"&gt;                                   &lt;span style="color: red"&gt; &lt;span style="background: yellow"&gt;Width&lt;/span&gt;&lt;/span&gt;&lt;span style="background: yellow; color: blue"&gt;="50"&lt;/span&gt;&lt;span style="color: red"&gt; DisplayMemberBinding&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; Length&lt;/span&gt;&lt;span style="color: blue"&gt;}" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridView&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;            &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;ListView.View&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Window&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;As you can see, I have highlighted the column’s in our GridView that have explicit width settings.  Now looking at what we get when we run this sample you can see that the default behaviour of the GridViewColumn is to set the width to AUTO thus fitting the content being displayed.  However, there often situations where you would rather the GridViewColum’s stretch to fit the remaining available space of its container. To achieve this you would imagine you could set the width of the GridViewColumn to “*”. Unfortunately this is not supported and you will be prompted with the following message. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: green"&gt;&lt;!-- Custom template--&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; Header&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="Names"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; &lt;span style="background: yellow"&gt;Width&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; background: yellow; color: blue"&gt;="*"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn.CellTemplate&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;            &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Border&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; Text&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="{&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt; .}"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                          &lt;span style="color: red"&gt; Foreground&lt;/span&gt;&lt;span style="color: blue"&gt;="Black"&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                          &lt;span style="color: red"&gt; FontWeight&lt;/span&gt;&lt;span style="color: blue"&gt;="Bold" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;            &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;Border&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn.CellTemplate&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;span style="font-size: 9pt; background: yellow"&gt;Cannot convert string '*' in attribute 'Width' to object of type 'System.Double'. '*'&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;I find this inconsistent use of the * in WPF frustrating, I am sure the WPF team have a valid reason for why this is not supported but it just feels like it should be. As the * is not supported on a GridViewColumn’s width I tried many other way to get our GridViewColumn to stretch, all to no avail. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="Stretch" ... &lt;/span&gt;&lt;span style="font-size: 9pt"&gt;Makes no difference.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; HorizontalContentAlignment&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="Stretch" ... &lt;/span&gt;&lt;span style="font-size: 9pt"&gt;Makes no difference.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="Stretch" ... &lt;/span&gt;&lt;span style="font-size: 9pt"&gt;Not supported.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;GridViewColumn&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; HorizontalContentAlignment&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="Stretch" ...&lt;/span&gt;&lt;span style="font-size: 9pt"&gt; Not supported.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;Having played around for a while and running a few google searches it became apparent that a number of people have come across this issue, particularly when trying to stretch the last column to the remaining space. As a result, I decided to solve the problem using the attached property approach. This provides a simple way if implementing the stretch column behaviour on ListView’s. As I will outline, you change the default behaviour of the GridView setting the width to Auto so that be default all columns will stretch. Below is the XAML that will allow us to do just that. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: #a31515"&gt;ListView&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt; Name&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="myListView"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;         &lt;span style="color: red"&gt; Background&lt;/span&gt;&lt;span style="color: blue"&gt;="LightBlue"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;         &lt;span style="color: red"&gt; ItemsSource&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="color: red"&gt; ourData&lt;/span&gt;&lt;span style="color: blue"&gt;}"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;         &lt;span style="color: red"&gt; &lt;span style="background: yellow"&gt;Extensions&lt;/span&gt;&lt;/span&gt;&lt;span style="background: yellow; color: blue"&gt;:&lt;/span&gt;&lt;span style="background: yellow; color: red"&gt;ListViewColumns.Stretch&lt;/span&gt;&lt;span style="background: yellow; color: blue"&gt;="true"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;For us to achieve this level of simplicity in our XAML we have to place the complexity elsewhere.....in our attached property infact. The first stage when creating a new WPF attached property is to put the appropriate infrastructure in place. You will find may examples of how to create attached properties in WPF so I won’t bore you with the details here. Below is base code for our attached property. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System.Windows;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System.Windows.Controls;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; System.Windows.Media;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; Demo.Extension.Properties&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; ListViewColumnStretch&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ListViewColumns&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;DependencyObject&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; IsStretched Dependancy property which can be attached to gridview columns.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af"&gt;DependencyProperty&lt;/span&gt; StretchProperty =&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;DependencyProperty&lt;/span&gt;.RegisterAttached(&lt;span style="color: #a31515"&gt;"Stretch"&lt;/span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: blue"&gt;bool&lt;/span&gt;),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;ListViewColumns&lt;/span&gt;),&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;UIPropertyMetadata&lt;/span&gt;(&lt;span style="color: blue"&gt;true&lt;/span&gt;,&lt;span style="color: blue"&gt;null&lt;/span&gt;,OnCoerceStretch));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Gets the stretch.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="obj" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The obj.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;returns&gt;&lt;/returns&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;bool&lt;/span&gt; GetStretch(&lt;span style="color: #2b91af"&gt;DependencyObject&lt;/span&gt; obj)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; (&lt;span style="color: blue"&gt;bool&lt;/span&gt;)obj.GetValue(StretchProperty);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Sets the stretch.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="obj" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The obj.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="value" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;if set to &lt;/span&gt;&lt;span style="color: gray"&gt;&lt;c&gt;&lt;/c&gt;&lt;/span&gt;&lt;span style="color: green"&gt;true&lt;/span&gt;&lt;span style="color: green"&gt; [value].&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; SetStretch(&lt;span style="color: #2b91af"&gt;DependencyObject&lt;/span&gt; obj, &lt;span style="color: blue"&gt;bool&lt;/span&gt; value)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            obj.SetValue(StretchProperty, value);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Called when [coerce stretch].&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;remarks&gt;&lt;/remarks&gt;&lt;/span&gt;&lt;span style="color: green"&gt;If this callback seems unfamilar then please read&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; the great blog post by Paul jackson found here. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; http://compilewith.net/2007/08/wpf-dependency-properties.html&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="source" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The source.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="value" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The value.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;returns&gt;&lt;/returns&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; OnCoerceStretch(&lt;span style="color: #2b91af"&gt;DependencyObject&lt;/span&gt; source, &lt;span style="color: blue"&gt;object&lt;/span&gt; value) &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;ListView&lt;/span&gt; lv = (source &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ListView&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Ensure we dont have an invalid dependancy object of type ListView.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (lv == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"This property may only be used on ListViews"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Setup our event handlers for this list view.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            lv.Loaded += &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;RoutedEventHandler&lt;/span&gt;(lv_Loaded);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            lv.SizeChanged += &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SizeChangedEventHandler&lt;/span&gt;(lv_SizeChanged);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; value;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;Firstly, notice that dependency property inherits from &lt;/span&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;DependencyObject&lt;/span&gt;&lt;span style="font-size: 9pt"&gt;, just about most elements in WPF derive from this type and attached properties are no exception. The remainder of the code above is fairly self explanatory, we have WPF setters and getters and we have registered the property name (&lt;/span&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;DependencyProperty&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;.RegisterAttached(&lt;span style="color: #a31515"&gt;"Stretch"&lt;/span&gt;) &lt;/span&gt;&lt;span style="font-size: 10pt"&gt;as part of this work. The only part that may not be recognised is the static method OnCoerceStretch. This method is actually just a callback that will be called prior to our property being set. It allows us to intercept the setter in order to change the the state of the value if so require. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt; OnCoerceStretch(&lt;span style="color: #2b91af"&gt;DependencyObject&lt;/span&gt; source, &lt;span style="color: blue"&gt;object&lt;/span&gt; value) &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: #2b91af"&gt;ListView&lt;/span&gt; lv = (source &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ListView&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: green"&gt;//Ensure we dont have an invalid dependancy object of type ListView.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;if&lt;/span&gt; (lv == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;throw&lt;/span&gt; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"This property may only be used on ListViews"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: green"&gt;//Setup our event handlers for this list view.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    lv.Loaded += &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;RoutedEventHandler&lt;/span&gt;(lv_Loaded);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    lv.SizeChanged += &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SizeChangedEventHandler&lt;/span&gt;(lv_SizeChanged);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;return&lt;/span&gt; value;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;In our coerce method above you can see we receive the dependency object the property has been attached to (in our case a listview) and then the value being set. The only this we really need to do in our method is to attach a couple of event handlers which will notify us later on about state changes in our listview. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: green"&gt;//Setup our event handlers for this list view.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    lv.Loaded += &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;RoutedEventHandler&lt;/span&gt;(lv_Loaded);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    lv.SizeChanged += &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SizeChangedEventHandler&lt;/span&gt;(lv_SizeChanged);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;The loaded handler is setup as we can only gain access to our listview’s internal GridView and columns once the listview has fully loaded. The SizeChanged event handler will be used to monitor when the ListView’s sizes changes, when this happens we want to be able to perform a calculation so that columns with no width having been set can stretch to fill the available space. Implementing the dependency property above allows us to use the following XAML syntax. &lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt;Extensions&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt;ListViewColumns.Stretch&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="true"&lt;/span&gt;&lt;span style="font-size: 9pt"&gt;. Don’t forget to import the namespace into your XAML like this &lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt;xmlns&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red"&gt;Extensions&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue"&gt;="clr-namespace:Demo.Extension.Properties"&lt;/span&gt;&lt;span style="font-size: 9pt"&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;Back to our dependency property, the event handlers are once again fairly self explanatory, each event handler calls into a method called SetColumnWidths. As the SizeChanged event is called prior to the loaded event a simple check is made to ensure SetColumnWidths is not called at this point. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt; Handles the SizeChanged event of the lv control.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray"&gt;
&lt;param name="sender" /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;The source of the event.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray"&gt;
&lt;param name="e" /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;The &lt;/span&gt;&lt;span style="font-size: 10pt; color: gray"&gt;&lt;see cref="System.Windows.SizeChangedEventArgs"&gt;&lt;/see&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;instance containing the event data.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;private&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; lv_SizeChanged(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;SizeChangedEventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: #2b91af"&gt;ListView&lt;/span&gt; lv = (sender &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ListView&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;if&lt;/span&gt; (lv.IsLoaded)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: green"&gt;//Set our initial widths.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        SetColumnWidths(lv);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt; Handles the Loaded event of the lv control.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray"&gt;
&lt;param name="sender" /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;The source of the event.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray"&gt;
&lt;param name="e" /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;The &lt;/span&gt;&lt;span style="font-size: 10pt; color: gray"&gt;&lt;see cref="System.Windows.RoutedEventArgs"&gt;&lt;/see&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt;instance containing the event data.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;private&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; lv_Loaded(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: #2b91af"&gt;ListView&lt;/span&gt; lv = (sender &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ListView&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: green"&gt;//Set our initial widths.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    SetColumnWidths(lv);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;The final part of the puzzle is too look at our method SetColumnsWidth. This method does the majority of the work in our dependency property, it identifies columns in our GridView which do not have a width setting and then based on the available space remaining divides to those columns. The only interesting part is that the columns identified as having no width are stored in the ListView’s TAG property for reuse later. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;span style="font-size: 10pt; color: green"&gt; Sets the column widths.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: gray"&gt;///&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue"&gt;private&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; SetColumnWidths(&lt;span style="color: #2b91af"&gt;ListView&lt;/span&gt; listView)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: green"&gt;//Pull the stretch columns fromt the tag property.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;GridViewColumn&lt;/span&gt;&gt; columns = (listView.Tag &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;GridViewColumn&lt;/span&gt;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;double&lt;/span&gt; specifiedWidth = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: #2b91af"&gt;GridView&lt;/span&gt; gridView = listView.View &lt;span style="color: blue"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af"&gt;GridView&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    &lt;span style="color: blue"&gt;if&lt;/span&gt; (gridView != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;if&lt;/span&gt; (columns == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Instance if its our first run.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            columns = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;GridViewColumn&lt;/span&gt;&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;// Get all columns with no width having been set.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;GridViewColumn&lt;/span&gt; column &lt;span style="color: blue"&gt;in&lt;/span&gt; gridView.Columns)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (!(column.Width &gt;= 0))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                    columns.Add(column);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;else&lt;/span&gt; specifiedWidth += column.ActualWidth;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;// Get all columns with no width having been set.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;GridViewColumn&lt;/span&gt; column &lt;span style="color: blue"&gt;in&lt;/span&gt; gridView.Columns)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;if&lt;/span&gt; (!columns.Contains(column))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                    specifiedWidth += column.ActualWidth;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: green"&gt;// Allocate remaining space equally.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;GridViewColumn&lt;/span&gt; column &lt;span style="color: blue"&gt;in&lt;/span&gt; columns)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;double&lt;/span&gt; newWidth = (listView.ActualWidth - specifiedWidth) / columns.Count;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (newWidth &gt;= 0) column.Width = newWidth - 10;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: green"&gt;//Store the columns in the TAG property for later use. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        listView.Tag = columns;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;And that’s pretty much it..... were done! If we run the sample now it will look like this. You can see the two [Name] columns are stretching to fill the available space.  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div align="center"&gt;&lt;img height="315" alt="" width="600" src="http://www.ontheblog.net/CMS/Portals/0/Images/lvstr.jpg" /&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; Sourcecode for this blog can be downloaded &lt;a href="http://www.ontheblog.net/CMS/Portals/0/Files/ListViewSample.zip"&gt;here.&lt;/a&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/37/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/37/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=37</guid>
      <pubDate>Sun, 13 Apr 2008 21:21:11 GMT</pubDate>
      <slash:comments>16</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=37</trackback:ping>
    </item>
    <item>
      <title>Silverlight Control Skins </title>
      <description>&lt;p&gt;Corrina Barber has a great &lt;a target="_blank" href="http://blogs.msdn.com/corrinab/archive/2008/03/24/a-new-control-skin-set.aspx"&gt;post &lt;/a&gt;about her new Silverlight controls skins which provide a pencil drawn visual style for the common controls.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="350" alt="" width="600" src="http://www.ontheblog.net/CMS/Portals/0/Images/Rough.jpg" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;a target="_blank" href="http://www.corrina_b.members.winisp.net/skins/rough/Testpage.html"&gt;Click to see live demo&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;Its great to see these kinda resources being available online. It showns the power of the WPF templating model and makes us think differently about how user interfaces can be delivered. V cool.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/36/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/36/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=36</guid>
      <pubDate>Tue, 08 Apr 2008 19:09:40 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=36</trackback:ping>
    </item>
    <item>
      <title>New look and feel for OnTheBlog.net</title>
      <description>&lt;p&gt;You may have noticed that the look of my site has changed a little. I kept getting comments that it was a little too white so i decided to jig it around a bit. As DNN implements a superb skinning architecture it was very easy to do.&lt;/p&gt;
&lt;p&gt;If you would like to see what the site used to look like you can click here.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.ontheblog.net/CMS/Home/tabid/36/Default.aspx?SkinSrc=http://www.ontheblog.net[G]%2fskins%2fflux%2faquawide"&gt;Old skin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/35/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/35/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=35</guid>
      <pubDate>Tue, 08 Apr 2008 10:56:54 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=35</trackback:ping>
    </item>
    <item>
      <title>Silverlight and Flex trends</title>
      <description>&lt;p&gt;I love playing with &lt;a target="_blank" href="http://www.google.com/trends"&gt;Google trends&lt;/a&gt;, today as a thought I decided to pop in a the following comparison for &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Adobe_Flex"&gt;Flex&lt;/a&gt; and &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Silverlight"&gt;Silverlight&lt;/a&gt;. Not much between them at the moment it seems.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="428" width="623" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/silverlightFlexTrends.jpg" /&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/34/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/34/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=34</guid>
      <pubDate>Sat, 05 Apr 2008 16:19:48 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=34</trackback:ping>
    </item>
    <item>
      <title>C# Binary Search</title>
      <description>&lt;p&gt;A &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Binary_search"&gt;binary search&lt;/a&gt; is an &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Algorithm"&gt;algorithm&lt;/a&gt; is able to find a specific value within a sorted array by making increasingly acurate guesses based on a comparision result. I was discussing this with a friend at work the other day and thought I would put one together in C# for illustrative purposes. &lt;/p&gt;
&lt;p&gt;First we need to create the array with random data and then sort this array. I decided that using &lt;a target="_blank" href="http://en.wikipedia.org/wiki/GUID"&gt;guids&lt;/a&gt; would provide a good level of random data for our test. I therefore create a million guids in my array then sort it. This is shown below.&lt;/p&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Mains the specified args.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="args" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The args.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Setup random data.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&gt; RandomItems = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;int&lt;/span&gt; i = 0; i &lt; 1000000; i++){RandomItems.Add(&lt;span style="color: #2b91af"&gt;Guid&lt;/span&gt;.NewGuid().ToString());}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Get search item and sort.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;string&lt;/span&gt; searchFor = RandomItems[345];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            RandomItems.Sort();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Press enter to run test"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.ReadLine();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;Next I created the algorithm which would quickly narrow down on the value we are searching for. There are 3 things to remember when it comes to binary searches.&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Find the median of a particular range within your array.&lt;/li&gt;
    &lt;li&gt;Compare the value at that midpoint to see if ths greaterthan, lessthan or Equal.&lt;/li&gt;
    &lt;li&gt;Call the same method recursively in order to narrow the search.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The Binary search class is shown below.&lt;/p&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Finds the index. (Public Overload.)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;typeparam name="T"&gt;&lt;/typeparam&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="sortedList" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The sorted list.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="searchCriteria" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The search criteria.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;returns&gt;&lt;/returns&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The index of the specified item.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; FindIndex(&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&gt; sortedList,&lt;span style="color: blue"&gt;string&lt;/span&gt; searchCriteria)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; FindIndex(sortedList, searchCriteria, 0,sortedList.Count);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: green"&gt; Finds the index.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="sortedList" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The sorted list.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="searchCriteria" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The search criteria.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;
&lt;param name="Startposition" /&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The startposition.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: gray"&gt;///&lt;/span&gt;&lt;span style="color: gray"&gt;&lt;returns&gt;&lt;/returns&gt;&lt;/span&gt;&lt;span style="color: green"&gt;The index of the specified &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        &lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; FindIndex(&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt; sortedList,&lt;span style="color: blue"&gt;string&lt;/span&gt; searchCriteria, &lt;span style="color: blue"&gt;int&lt;/span&gt; startPosition, &lt;span style="color: blue"&gt;int&lt;/span&gt; endPosition)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;int&lt;/span&gt; lastPos = startPosition;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;int&lt;/span&gt; range = (endPosition - startPosition);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (range == 0) &lt;span style="color: blue"&gt;return&lt;/span&gt; 0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;int&lt;/span&gt; midPoint = (range / 2) + startPosition;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;int&lt;/span&gt; equality = sortedList[midPoint].CompareTo(searchCriteria);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(midPoint);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Equals&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (equality == 0)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;return&lt;/span&gt; midPoint;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Greater than&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (equality == -1)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;return&lt;/span&gt; FindIndex(sortedList, searchCriteria, midPoint, endPosition);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: green"&gt;//Less than&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt; (equality == 1)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: blue"&gt;return&lt;/span&gt; FindIndex(sortedList, searchCriteria, lastPos, midPoint);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt; -1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;     &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;p&gt; Finally, I want to run the algorithm and work out the cost of finding my value within a million strings. So we need to add the following to our static main.&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: green"&gt;//Run our binary search.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;DateTime&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; start = &lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;.Now;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;Console&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Item found at position ["&lt;/span&gt; + &lt;span style="color: #2b91af"&gt;BinarySearch&lt;/span&gt;.FindIndex(RandomItems, searchFor).ToString() + &lt;span style="color: #a31515"&gt;"]"&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;DateTime&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; end = &lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;.Now;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;Console&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Cost M/s: "&lt;/span&gt; + &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;TimeSpan&lt;/span&gt;(end.Ticks - start.Ticks).TotalMilliseconds.ToString());&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: #2b91af"&gt;Console&lt;/span&gt;&lt;span style="font-size: 10pt"&gt;.ReadLine();&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt; The results of running this algorithm are shown here.&lt;/p&gt;
&lt;div&gt;&lt;strong&gt;Press enter to run test&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;500000&lt;br /&gt;
250000&lt;br /&gt;
375000&lt;br /&gt;
312500&lt;br /&gt;
343750&lt;br /&gt;
328125&lt;br /&gt;
335937&lt;br /&gt;
332031&lt;br /&gt;
330078&lt;br /&gt;
329101&lt;br /&gt;
329589&lt;br /&gt;
329833&lt;br /&gt;
329955&lt;br /&gt;
330016&lt;br /&gt;
329985&lt;br /&gt;
330000&lt;br /&gt;
330008&lt;br /&gt;
330012&lt;br /&gt;
330014&lt;br /&gt;
330013&lt;br /&gt;
Item found at position [330013]&lt;br /&gt;
Cost M/s: 5&lt;/strong&gt;&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/33/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/33/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=33</guid>
      <pubDate>Mon, 07 Apr 2008 12:50:37 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=33</trackback:ping>
    </item>
    <item>
      <title>Macbook Pro and Vista</title>
      <description>&lt;p&gt;I recently updated my laptop to a &lt;a target="_blank" href="http://www.apple.com/macbookpro/"&gt;Macbook Pro&lt;/a&gt; 2.6Ghz Intel Core 2 Duo with 4gb of ram with the 200gb 7200rpm disk. I have created a windows partition on the machine and installed vista, Visual Studio 2008, SQL Server 2005, Office 2007 etc etc.&lt;/p&gt;
&lt;p&gt;Anyways, Just wanted to express that this machine is blisteringly fast! My performance score is shown below.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="299" width="400" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/perfscoreMacbook.jpg" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/32/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/32/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=32</guid>
      <pubDate>Wed, 02 Apr 2008 12:51:45 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=32</trackback:ping>
    </item>
    <item>
      <title>Decompiling Silverlight Apps</title>
      <description>&lt;p&gt;Did you know you can decompile Silverlight apps? As with ever other .NET app, if you have the assemblies you can pretty much load them into &lt;a target="_blank" href="http://www.rarlab.com/"&gt;reflector &lt;/a&gt;and view the source.&lt;/p&gt;
&lt;p&gt;So when it comes to silverlight how do you get the assemblies in the first place? Well it turns out when you develop your app all the assemblies are packages into a XAP file which is then downloaded to the client.&lt;/p&gt;
&lt;p&gt;An XAP is actually just a zip file with a different extension. Therefore, all you need to do is the following.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.) Locate the XAP file on a web page or file system by looking at the source.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="236" alt="" width="613" src="http://www.ontheblog.net/CMS/Portals/0/Images/sourceXap.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.) Place into the browser and download the XAP package.&lt;/strong&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="279" alt="" width="415" src="http://www.ontheblog.net/CMS/Portals/0/Images/savexap.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3.) Once downloaded, change the XAP extension to .ZIP&lt;/strong&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="278" alt="" width="242" src="http://www.ontheblog.net/CMS/Portals/0/Images/renamexap.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4.) Extract the package using whichever tool you like. I use &lt;a target="_blank" href="http://www.rarlab.com/"&gt;WINRAR&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="125" alt="" width="499" src="http://www.ontheblog.net/CMS/Portals/0/Images/filesxap.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5.) Locate the assemblies in reflector and view the source.&lt;/strong&gt; &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/teeth_smile.gif" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="441" alt="" width="488" src="http://www.ontheblog.net/CMS/Portals/0/Images/disassembledxap.jpg" /&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/31/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/31/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=31</guid>
      <pubDate>Sat, 29 Mar 2008 20:48:08 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=31</trackback:ping>
    </item>
    <item>
      <title>Linq Gotcha: Deferred Queries</title>
      <description>&lt;div&gt; &lt;/div&gt;
&lt;div&gt;In Linq there are two kinds of queries you can execute on objects. &lt;strong&gt;Deferred&lt;/strong&gt; and &lt;strong&gt;Non-Deferred&lt;/strong&gt;. As expected, non-deferred queries will be executed immediately, deferred queries on the other hand will not be executed until iterate over the collection.&lt;/div&gt;
&lt;div&gt;  &lt;/div&gt;
&lt;div&gt;With that in mind take the following query&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;string&lt;/span&gt;[] servers = { &lt;span style="color: #a31515"&gt;"Server 1"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Server 2"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Dave"&lt;/span&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt; results = servers.Where(server =&gt; &lt;span style="color: #2b91af"&gt;Char&lt;/span&gt;.IsDigit(server[7]));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;In this query we want to bring back the first two elements in our array which have a number at the 7&lt;sup&gt;th&lt;/sup&gt; index, therefore we would get two results returned.  However, although this code compiles, we have actually created a situation whereby a System.IndexOutOfRange exception will be thrown whenever this query is executed, this is because the  server name Dave is only 4 chars long.   This should be easy to find if we start using our results collection directly below our query but this may not always be the case. We may do the following.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;string&lt;/span&gt;[] servers = { &lt;span style="color: #a31515"&gt;"Server 1"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Server 2"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Dave"&lt;/span&gt; };&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&gt; results = servers.Where(server =&gt; &lt;span style="color: #2b91af"&gt;Char&lt;/span&gt;.IsDigit(server[7]));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;                                &lt;span style="font-size: 10pt"&gt;ConnectToServer(results);&lt;/span&gt;            &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Our ConnectToServer method&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;                &lt;span style="font-size: 10pt; color: blue"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt"&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; ConnectToServer(&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&lt;&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&gt; servers)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;      {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;            &lt;span style="color: blue"&gt;if&lt;/span&gt;(servers.Count &gt; 0)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;                &lt;span style="color: green"&gt;//Do Something&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt"&gt;      }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;In this scenario, out System.IndexOutOfRange exception will be thrown from within the ConnectToServer method which may not have changed in years.  By using linq are we possibly making it very difficult for ourselves when trying to track down errors?&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/29/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/29/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=29</guid>
      <pubDate>Sat, 05 Apr 2008 16:05:02 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=29</trackback:ping>
    </item>
    <item>
      <title>Multiple Browser Compatibility</title>
      <description>&lt;p&gt;&lt;a href="http://www.ontheblog.net/CMS/Feeds/TechBlogs/RockfordLhotka/tabid/95/Default.aspx"&gt;Rockford&lt;/a&gt; has an interesting post about a website called &lt;a href="http://browsershots.org"&gt;http://browsershots.org&lt;/a&gt;. The idea is, you submit a url and they will check how your website renders in 45+ browsers on multiple operating systems and provide screenshots for you to download. They also do some cool javascript testing as well.&lt;/p&gt;
&lt;p&gt;Below is an a screenshot of the initial results page for the home page of my site.&lt;/p&gt;
&lt;p&gt;&lt;img height="535" width="544" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/browserhosts2.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;And here is what my site looks like in &lt;a target="_blank" href="http://www.ontheblog.net/CMS/Portals/0/Images/operalinux.jpg"&gt;Opera running on linux&lt;/a&gt;. V.cool.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/27/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/27/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=27</guid>
      <pubDate>Mon, 24 Mar 2008 17:40:49 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=27</trackback:ping>
    </item>
    <item>
      <title>WPF Easter Egg</title>
      <description>&lt;p&gt;Ok I'm sure you were hoping I was going to announce something cool like the &lt;a href="http://www.eggheaven.com/browse/software/en137" target="_blank"&gt;hidden flight simulator in excel&lt;/a&gt;. &lt;img src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/teeth_smile.gif" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Sorry, here is some XAML instead.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img width="400" height="266" src="http://www.ontheblog.net/CMS/Portals/0/Images/wpfeasteregg.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt; Windowless Easter Egg&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Window&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; x&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt;Class&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="WindowlessForms.Window1"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="Window1"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="400"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="600"&lt;/span&gt;&lt;span style="color: red;"&gt; WindowStyle&lt;/span&gt;&lt;span style="color: blue;"&gt;="None"&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;       &lt;span style="color: red;"&gt; AllowsTransparency&lt;/span&gt;&lt;span style="color: blue;"&gt;="True"&lt;/span&gt;&lt;span style="color: red;"&gt; Background&lt;/span&gt;&lt;span style="color: blue;"&gt;="Transparent"&lt;/span&gt;&lt;span style="color: red;"&gt; WindowStartupLocation&lt;/span&gt;&lt;span style="color: blue;"&gt;="CenterScreen"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Border&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Ellipse&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Stroke&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="Black"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;            &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Ellipse.Fill&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;RadialGradientBrush&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; GradientOrigin&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0,0.4"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Center&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0,0.5"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; RadiusX&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="1"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; RadiusY&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="2"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;RadialGradientBrush.GradientStops&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="AliceBlue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0"/&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="Blue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0.1" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="AliceBlue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0.2" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="blue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0.3" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="AliceBlue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0.4" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="Blue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0.5" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="AliceBlue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0.6" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="blue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0.7" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="AliceBlue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0.8" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="blue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="0.9" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;GradientStop&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Color&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="AliceBlue"&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; Offset&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="1" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                    &lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;RadialGradientBrush.GradientStops&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;                &lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;RadialGradientBrush&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;            &lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Ellipse.Fill&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;        &lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Ellipse&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;    &lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Border&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;&lt;/Window&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/26/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/26/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=26</guid>
      <pubDate>Mon, 24 Mar 2008 09:47:02 GMT</pubDate>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=26</trackback:ping>
    </item>
    <item>
      <title>Robotics gone wrong</title>
      <description>&lt;p&gt;Something has definately gone wrong here.... A quick browse for robots on the web turns up a robot trying to be human and a human trying to be a robot.&lt;/p&gt;
&lt;p align="center"&gt;&lt;a title="Robot Albert Hubo" target="_new" href="http://video.msn.com/video.aspx?vid=cf200f67-44d0-49af-9ca3-0824267fe979"&gt;&lt;img height="84" alt="Robot Albert Hubo" width="112" border="0" src="http://www.ontheblog.nethttp://img2.catalog.video.msn.com/Image.aspx?uuid=cf200f67-44d0-49af-9ca3-0824267fe979&amp;w=112&amp;h=84" /&gt;&lt;br /&gt;
Robot Albert Hubo&lt;/a&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;a title="Robot Dance" target="_new" href="http://video.msn.com/video.aspx?vid=6b47063d-e73f-45c1-8f21-4bc57afb3ee1"&gt;&lt;img height="84" alt="Robot Dance" width="112" border="0" src="http://www.ontheblog.nethttp://img2.catalog.video.msn.com/Image.aspx?uuid=6b47063d-e73f-45c1-8f21-4bc57afb3ee1&amp;w=112&amp;h=84" /&gt;&lt;br /&gt;
Robot Dance&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/25/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/25/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=25</guid>
      <pubDate>Thu, 20 Mar 2008 20:42:05 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=25</trackback:ping>
    </item>
    <item>
      <title>Web 3.0 and search engines</title>
      <description>&lt;p&gt;Take the following statement.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Googlebot processes each of the pages it crawls in order to compile a massive index of all the words it sees and their location on each page. In addition, we process information included in key content tags and attributes, such as Title tags and ALT attributes. Googlebot can process many, but not all, content types. For example, we cannot process the content of most Flash files or dynamic pages.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;You can find this text in the google indexing FAQ site &lt;a target="_blank" href="http://www.google.com/support/webmasters/bin/answer.py?answer=70897&amp;ctx=sibling"&gt;here&lt;/a&gt;. What I find compelling about this statement is that of the last line..&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;we cannot process the content of most Flash files or dynamic pages.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This raises an interesting question with regard to the future of search engines as we enter the &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Web_3"&gt;web 3.0&lt;/a&gt; era. As HTML has slowely reached the limits of what it can offer, we are starting to see the rise of new rich/smart client style applications based on technolgies such as &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Silverlight"&gt;silverlight,&lt;/a&gt; &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Adobe_Flex"&gt;Flex&lt;/a&gt; and &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Adobe_Flash"&gt;Flash&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://en.wikipedia.org/wiki/Tim_Berners-Lee"&gt;Tim Berners-Lee&lt;/a&gt; has predicted that web 3.0 could possibly be based on vector graphics platforms. These technologies offer rich vector graphics with runtime libraires that are delivered direct to the desktop. With these runtimes comes the use of custom binary formats that allow code to be run within the browser and peform functions that standard HTML/&lt;a target="_blank" href="http://en.wikipedia.org/wiki/Ajax_%28programming%29"&gt;Ajax&lt;/a&gt; apps would dream of. &lt;/p&gt;
&lt;p&gt;So with the winds of change coming....how will search engines continue to perform effective indexing of site content when its delivered in custom binary formats?&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Will we see new standards defined that will be specifically used for the publication &amp; management of site content for indexing?&lt;/li&gt;
    &lt;li&gt;Will search engines implement new techniques for indexing binary files?&lt;/li&gt;
    &lt;li&gt;Will our Web 3.0 apps always require HTML equivalents for supporting search providers?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I dont know the answers to these questions yet but I am looking forward to seeing how it pans out.&lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/wink_smile.gif" /&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/24/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/24/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=24</guid>
      <pubDate>Thu, 20 Mar 2008 10:01:31 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=24</trackback:ping>
    </item>
    <item>
      <title>User Agents for February</title>
      <description>&lt;p&gt;Looking through my logs I decided to compose a list of &lt;a target="_blank" href="http://en.wikipedia.org/wiki/User_agent"&gt;useragents/browsers&lt;/a&gt; visiting my site during feb.  I was amazed to see that there were still people using  &lt;a target="_blank" href="http://www.ontheblog.net/CMS/Portals/0/Images/ie2.gif"&gt;IE2&lt;/a&gt; out there! I mean.... really???&lt;/p&gt;
&lt;p&gt;These results are shown below.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Netscape Navigator 6+ &lt;br /&gt;
Internet Explorer &lt;br /&gt;
Internet Explorer 6 &lt;br /&gt;
Netscape Navigator 4 &lt;br /&gt;
Internet Explorer 5 &lt;br /&gt;
Internet Explorer 4 &lt;br /&gt;
WebAlta Crawler/2.0 (&lt;/strong&gt;&lt;a href="http://www.webalta.net/ru/about_webmaster.html"&gt;&lt;strong&gt;http://www.webalta.net/ru/about_webmaster.html&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;) (Windows; U; Windows NT 5.1; ru-RU) &lt;br /&gt;
MSNBOT &lt;br /&gt;
msnbot/1.1 (+http://search.msn.com/msnbot.htm) &lt;br /&gt;
Internet Explorer 2 &lt;br /&gt;
Feedfetcher-Google; (+http://www.google.com/feedfetcher.html; 3 subscribers; feed-id=10707310861055891819) &lt;br /&gt;
Feedfetcher-Google; (+http://www.google.com/feedfetcher.html; 2 subscribers; feed-id=10707310861055891819) &lt;br /&gt;
ia_archiver &lt;br /&gt;
Netscape Navigator 3 &lt;br /&gt;
BlogPulse (ISSpider-3.0) &lt;br /&gt;
BlogPulseLive (&lt;/strong&gt;&lt;a href="http://www.ontheblog.netmailto:support@blogpulse.com"&gt;&lt;strong&gt;support@blogpulse.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;) &lt;br /&gt;
EnaBot/1.2 (&lt;/strong&gt;&lt;a href="http://www.enaball.com/crawler.html"&gt;&lt;strong&gt;http://www.enaball.com/crawler.html&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;) &lt;br /&gt;
freedir.co.uk/0.8 (+http://freedir.co.uk/directory/) &lt;br /&gt;
Opera/8.00 (Windows NT 5.1; U; en) &lt;br /&gt;
NewsGatorOnline/2.0 (&lt;/strong&gt;&lt;a href="http://www.newsgator.com"&gt;&lt;strong&gt;http://www.newsgator.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;; 1 subscribers) &lt;br /&gt;
Opera/9.0 (Windows NT 5.1; U; en) &lt;br /&gt;
Opera/9.00 (Windows NT 5.1; U; en) &lt;br /&gt;
Opera/9.26 (Windows NT 6.0; U; en) &lt;br /&gt;
psbot/0.1 (+http://www.picsearch.com/bot.html) &lt;br /&gt;
SurveyBot/2.3 (Whois Source) &lt;br /&gt;
Technoratibot/0.7 &lt;br /&gt;
Tgulhz enqb iwgovpdqc &lt;br /&gt;
Wkivtc bnfswe wvdu &lt;br /&gt;
Pxmtonqhj szftv djhiesuc &lt;br /&gt;
Opera/9.50 (Windows NT 5.0; U; pt-br) &lt;br /&gt;
Opera/9.00 (Windows NT 5.1; U; ru) &lt;br /&gt;
Opera/9.23 (Windows NT 5.1; U; en) &lt;br /&gt;
Opera/9.24 (Windows NT 5.1; U; en) &lt;br /&gt;
Opera/9.26 (Windows NT 5.1; U; cs) &lt;br /&gt;
Opera/7.50 (X11; Linux i686; U) [en] &lt;br /&gt;
Opera/8.0 (Macintosh; PPC Mac OS X; U; en) &lt;br /&gt;
Opera/8.01 (Windows NT 5.1) &lt;br /&gt;
Internet Explorer 3 &lt;br /&gt;
Ajuqwt tdmy djrpagf &lt;br /&gt;
Java/1.6.0_02 &lt;br /&gt;
Jyxgil mryhla ugxwa &lt;br /&gt;
Lwizpcxo mgvx lsxa&lt;/strong&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/23/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/23/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=23</guid>
      <pubDate>Wed, 19 Mar 2008 19:28:58 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=23</trackback:ping>
    </item>
    <item>
      <title>FUN: Easters coming</title>
      <description>&lt;p&gt;Looking through my emails I found a few easter related jokes bouncing around. This one particulary made me laugh so thought I would share. &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/teeth_smile.gif" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="300" width="468" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/bunnies.jpg" /&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/22/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/22/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=22</guid>
      <pubDate>Mon, 17 Mar 2008 20:50:07 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=22</trackback:ping>
    </item>
    <item>
      <title>Silverlight 2 Control Template Browser Source Code</title>
      <description>&lt;p&gt;Just been snowboarding in Austria for the last few days. Had some great snow and a litte stiff today. I just wanted to blog quickly to tell you that you can now download the source code for the &lt;a target="_blank" href="http://www.ontheblog.net/silverlight/controltemplatebrowser.html"&gt;Silverlight 2 Control Template browser&lt;/a&gt;. Please note, this version currently uses an embedded XML file to render each template. I am working on updating this to use a XAMLWriter implementation but this is still a work in progress.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.ontheblog.net/CMS/Portals/0/Files/SilverSurfer.zip"&gt;Download&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/21/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/21/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=21</guid>
      <pubDate>Mon, 17 Mar 2008 20:30:07 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=21</trackback:ping>
    </item>
    <item>
      <title>Silverlight 2 Control Template Browser</title>
      <description>&lt;p align="center"&gt;&lt;a target="_blank" href="http://www.ontheblog.net/silver/TemplateDemo.html"&gt;&lt;img height="289" alt="" width="400" src="http://www.ontheblog.net/CMS/Portals/0/Images/templateBrowser.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After a fairly hectic week I finally had a chance to sit down and have a play with the new &lt;a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=4E03409A-77F3-413F-B108-1243C243C4FE&amp;displaylang=en"&gt;Silverlight 2 beta 1 release&lt;/a&gt;. I have been waiting a long time for this release as it finally provides Silverlight with some of the key features that have made WPF such a compelling framework to work with.&lt;/p&gt;
&lt;p&gt;In order to get to grips with these features, I decided that I would write a simple control template browser that users can access over the web. Control Templates are the default look and feel that are implemented by Silverlight controls. The template browser allows you to choose a control from the side menu and will display the control template in the right had pane. Building this kind of tool is useful for a number of reasons, firstly I hadn’t seen a &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Zero_Install"&gt;zero-install&lt;/a&gt; implementation and secondly it provides just enough scope for me to assess the new features available. Below is a summary of the areas I have tested as part of this tool.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;The new control libraries.&lt;/li&gt;
    &lt;li&gt;New flow layout containers such as Grid, StackPanel and Borders.&lt;/li&gt;
    &lt;li&gt;Overriding of control templates&lt;/li&gt;
    &lt;li&gt;Defining styles in the resources section&lt;/li&gt;
    &lt;li&gt;Databinding of styles&lt;/li&gt;
    &lt;li&gt;Data templates &amp; business object bindings&lt;/li&gt;
    &lt;li&gt;.NET Framework support&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In writing the control template browser I found that the designer support in visual studio worked well. I would randomly get some error about not being able to attach to the browser process but this was fixed with a quick restart of VS2008.&lt;/p&gt;
&lt;p&gt;The controls available as part of Silverlight 2 have the majority of the most commonly used properties, now and then however you will find holes in this which may make you scratch your head.  Generally though I think the team have done a good job. Just one note on controls... there is no ComboBox...Why? Also I couldn’t get the textbox scrollbars to display.&lt;/p&gt;
&lt;p&gt;I did find a rather frustrating issue with the fact that I could not use the MergeDictionary class in my XAML to import styles from other resource files. The result is that I had to declare all my styles in the resources at the top of my page. &lt;/p&gt;
&lt;p&gt;Other than these few niggles which have work arounds, I reckon future of Silverlight look bright.  I intend to test the network support in Silverlight in a future blog. But I have snowboarding to do before then!&lt;/p&gt;
&lt;p&gt;Links&lt;br /&gt;
Source Code&lt;br /&gt;
&lt;a target="_blank" href="http://www.ontheblog.net/silverlight/ControlTemplateBrowser.html"&gt;View Silverlight Control Template Browser&lt;/a&gt;&lt;br /&gt;
Known Issue: Template not loading for TextBox Control&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/20/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/20/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=20</guid>
      <pubDate>Mon, 09 Jun 2008 20:36:37 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=20</trackback:ping>
    </item>
    <item>
      <title>Silverlight on the go.... Nokia gets the Jump</title>
      <description>&lt;p&gt;&lt;span style="font-size: 9pt; font-family: "Arial","sans-serif""&gt;Well it seems one of the &lt;a href="http://www.theregister.co.uk/2008/03/04/s60_silverlight/"&gt;&lt;u&gt;big annoucments&lt;/u&gt;&lt;/a&gt; that was due to be made at Mix 08 is that Silverlight is coming to mobile devices and more importantly... &lt;a href="http://www.nokia.com/"&gt;Nokia&lt;/a&gt; handsets. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; font-family: "Arial","sans-serif""&gt;There is apparently going to be a demo of an S60 device running Silverlight mobile edition which I can wait to see!  Will post more when it arrives! &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;The Nokia s60&lt;/strong&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="382" width="227" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/Nokias60.jpg" /&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/19/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/19/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=19</guid>
      <pubDate>Tue, 04 Mar 2008 12:50:50 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=19</trackback:ping>
    </item>
    <item>
      <title>WPF: Extending the Page &amp; UserControl base classes</title>
      <description>&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt;"&gt;When working with different .NET technologies it is often good practice to extend a number of bases classes for your own requirements.  There are couple of benefits for doing this.&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;span style="font-size: 9pt;"&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt;"&gt;The derived classes provide a layer of protection/abstraction from the core framework so that changes can be managed more effectively. &lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;&lt;span style="font-size: 9pt;"&gt;The derived classes provide the ability for you to extend base behaviour and share that throughout your application. &lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;&lt;span style="font-size: 9pt;"&gt;You can increase testability.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt;"&gt;Generally, when starting a new development, I like to do some of this infrastructure work upfront, this saves me a lot of refactoring down the line when I realise I need to extend a base class. Following this approach is particularly useful when working with .NET UI technologies such as &lt;a href="http://en.wikipedia.org/wiki/Windows_Forms"&gt;WinForms&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Asp.net"&gt;ASP.NET&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation"&gt;WPF&lt;/a&gt; which implement a number of base classes upon which the majority of UI components are based. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt;"&gt;Below is an example of the standard WinForms model whereby each Form is derived from System.Windows.Forms.Form versus the model I implement when I intend to extend the base Form class. &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p align="center"&gt;&lt;span style="font-size: 9pt;"&gt;&lt;img width="450" height="541" src="http://www.ontheblog.net/CMS/Portals/0/Images/Base-Vs-Derived.gif" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt;"&gt;FormEx implementation&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Linq;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Text;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Forms;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; Extended.Base.Example&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;FormEx&lt;/span&gt;: &lt;span style="color: rgb(43, 145, 175);"&gt;Form&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt;"&gt;Our StandardForm implementation&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.ComponentModel;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Data;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Drawing;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Linq;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Text;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Forms;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; Extended.Base.Example&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;StandardForm&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;FormEx&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; StandardForm()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;            InitializeComponent();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt;"&gt;All this works fine and you can compile and run the application. WinForms will not care if we have extended System.Windows.Forms as long as we still have the class in our inheritance hierarchy and it adheres to the same contract.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt;"&gt;Now I am currently working on a WPF &lt;a href="http://en.wikipedia.org/wiki/XBAP#Deployment"&gt;XBAP&lt;/a&gt; application and I want to use the same pattern within the world of WPF. You would imagine that this should be a fairly simple task. Each Page derives from System.Windows.Control.Page and User controls derived from System.Windows.Controls.UserControl. Therefore, it would seem logical that all that is required is to create a number of new classes that inherit the appropriate base class and then allow our new pages/controls to inherit from these. Below is some simple code to reflect this approach in an XBAP.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Our new derived Page Class&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Linq;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Text;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Controls;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; Demo&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;PageEx&lt;/span&gt;: &lt;span style="color: rgb(43, 145, 175);"&gt;Page&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;A XAML page inheriting our extended class.&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Linq;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Text;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Controls;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Data;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Documents;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Input;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Media;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Media.Imaging;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Navigation;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; System.Windows.Shapes;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt; Demo&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: gray;"&gt;&lt;summary&gt;&lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Interaction logic for Page1.xaml&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    &lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Page1&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;PageEx&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; Page1()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;            InitializeComponent();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;And the XAML for our Page&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Page&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; x&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt;Class&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="Demo.Page1"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="Page1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;        &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Page&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;All we should need to do now is compile and run our application.  If we do this, we notice that it’s not going to be as simple as we thought. Below is an error displayed from Visual Studio 2008.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;img width="529" height="40" src="http://www.ontheblog.net/CMS/Portals/0/Images/visualStudio_err1.gif" alt="" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;p&gt;The&lt;strong&gt; “Partial declarations of 'Your Type' must not specify different base classes”&lt;/strong&gt; message is a standard compiler message that you can get whenever you implement a class using partial class files and then forget to may sure they all derive from the same base class. At first this error message seems a little odd as you only have one class in your solution window and that’s correctly deriving from PageEx.&lt;/p&gt;
&lt;p&gt;The reason you encounter this error is due to the fact that WPF pages and controls have an auto generated file which is created by the compiler. This code is used for initialising the &lt;a href="http://en.wikipedia.org/wiki/Xaml"&gt;XAML&lt;/a&gt; document as some other gubbings.  Therefore we need to update this file to ensure it reflects our new base class. If you want to see this class all you need to do is place the cursor on the InitializeComponent, right click and then choose “Goto Definition”. Doing this will be present you with the following.&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt; &lt;a href="http://www.ontheblog.net/CMS/Portals/0/Images/partialClasswpf.gif" target="_blank"&gt;View&lt;/a&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So now we can see where our problem is, we can update the generated file to the following.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Page1&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;PageEx&lt;/span&gt;, System.Windows.Markup.&lt;span style="color: rgb(43, 145, 175);"&gt;IComponentConnector&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;p&gt;If you go about running the application the application runs with no problems.  But this is not the end of the story. After working elsewhere in your application you may find that all of sudden the issue of partial classes returns. Looking at the generated file you will notice that it has regressed back to inheriting from System.Windows.Controls.Page.&lt;/p&gt;
&lt;p&gt;When I first encountered this I scratched my head for a little and performed a few google searches. I eventually found that the problem was not related to generated file but that my XAML also needed to amended to reflect the extended base class. Below is the updated XAML file which shows my new XAML.&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;local&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;PageEx&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; x&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt;Class&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="Demo.Page1"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; xmlns&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;local&lt;/span&gt;&lt;span style="color: blue;"&gt;="clr-namespace:Demo"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt;"&gt;   &lt;span style="color: red;"&gt; Title&lt;/span&gt;&lt;span style="color: blue;"&gt;="Page1"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;        &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;    &lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;local&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;PageEx&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The first step is to import the namespace where your extended Page class resides.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: red;"&gt;xmlns&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt;local&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="clr-namespace:Demo"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Then we need to update our Pages opening and closing tags to reflect the new type using the namespace alias we defined. In this case called local&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;local&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: rgb(163, 21, 21);"&gt;PageEx&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt; x&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;:&lt;/span&gt;&lt;span style="font-size: 10pt; color: red;"&gt;Class&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue;"&gt;="Demo.Page1"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Now if you run the application you will no longer receive the “Partial Class” error and you can get onto the fun stuff! You will also need to use the same approach if you plan to extend other WPF base classes.&lt;/div&gt;
&lt;div&gt;   &lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/17/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/17/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=17</guid>
      <pubDate>Mon, 25 Feb 2008 22:50:15 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=17</trackback:ping>
    </item>
    <item>
      <title>WPF Ribbonbar and more coming in 2008!</title>
      <description>&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Scott_Guthrie"&gt;Scott Gu&lt;/a&gt; has &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/02/19/net-3-5-client-product-roadmap.aspx"&gt;shed some light&lt;/a&gt; on some of the changes coming to WPF this year. Notably, Scott inidcates that there will be new contols for WPF, one of which is a new a "&lt;a href="http://en.wikipedia.org/wiki/Ribbon_(computing)"&gt;Ribbon&lt;/a&gt;" control. I have thought that for a while that Microsoft needed to get this control to market as the Office 2007 styling has become quite popular.&lt;/p&gt;
&lt;p&gt;There are a number of vendors that do offer a WPF ribbon these are shown below.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.divil.co.uk/net/"&gt;Divelements&lt;/a&gt; - Sandock Ribbon (&lt;a href="http://www.divelements.co.uk/net/controls/sandribbonwpf/xbap/SandRibbonXBAPDemo.xbap"&gt;Xbap demo&lt;/a&gt;)&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.devcomponents.com/dotnetbar-wpf/"&gt;DotNetBar Ribbon&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.actiprosoftware.com/"&gt;Actipro&lt;/a&gt; (&lt;a href="http://www.actiprosoftware.com/Products/DotNet/WPF/WPFStudio/LiveDemo/publish.htm"&gt;Xbap demo&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also it seems more graphic intensive features such as shadowing etc are being pushed onto the graphics hardware increasing performance. V.cool!&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/16/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/16/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=16</guid>
      <pubDate>Thu, 21 Feb 2008 12:32:42 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=16</trackback:ping>
    </item>
    <item>
      <title>Silverlight 2.0! Cant wait! </title>
      <description>&lt;p&gt;I have just finished &lt;a href="http://www.dotnetrocks.com/default.aspx?showNum=316"&gt;listening&lt;/a&gt; to &lt;a href="http://weblogs.asp.net/scottgu/"&gt;Scott Gu's&lt;/a&gt; comments on Silverlight 2.0. From what he is saying 2.0 should finally offer the level of functionality to truly make Silverlight a compelling option.&lt;/p&gt;
&lt;p&gt;Just to summarise....Silverlight 2.0 will get the following.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Large suite of controls for developing LOB style applications&lt;/li&gt;
    &lt;li&gt;Databinding support&lt;/li&gt;
    &lt;li&gt;Styling and control templating&lt;/li&gt;
    &lt;li&gt;Flowlayout support&lt;/li&gt;
    &lt;li&gt;WCF Communications stack support&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Good news!&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/15/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/15/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=15</guid>
      <pubDate>Mon, 18 Feb 2008 13:44:39 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=15</trackback:ping>
    </item>
    <item>
      <title>Alt.NET Seattle</title>
      <description>&lt;p&gt;Having attended the Alt.net UK conference a few weeks ago I am disappointed by the fact that I cannot make the &lt;a href="http://altdotnet.org/events/2"&gt;US event&lt;/a&gt;. There's going to be some great people there and the chance to discuss topics with them would have been great.&lt;/p&gt;
&lt;p&gt;I am making sense of my decision using the following. &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/confused_smile.gif" /&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Its expensive to head over to the US just for a conference.&lt;/li&gt;
    &lt;li&gt;I am  getting married this year and need to save some money.&lt;/li&gt;
    &lt;li&gt;The "Mrs" gets jealous and thinks its a holiday.&lt;/li&gt;
    &lt;li&gt;There will be other events.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With that I rest my case.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/14/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/14/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=14</guid>
      <pubDate>Fri, 15 Feb 2008 10:24:49 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=14</trackback:ping>
    </item>
    <item>
      <title>Random muttering: Visualising Test Coverage</title>
      <description>&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Ok, this one will is going to sound a little odd but bare with me. The other day I received a call from a friend who I used to work with. He’s now moved on to a new company and is responsible for managing a team of developers who have been focused on developing internal systems.  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Upon starting with the company, the IT director had expressed his concerns that the development teams were generally gun ho about configuration management and that on many occasions critical systems had been down for extended periods. Basically, my friends role is to get a grip with these kind of issues and improve the overall quality and professionalism of the team. &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;He told me that the systems had been written in .net 1.1 and very little progress had been in terms of migrating them to 2.0 and definately no 3.5. Another key issue he had identified was that the application had absolutely no &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Code_coverage"&gt;code coverage&lt;/a&gt; and therefore developers were unaware of what impact their changes could have to the behaviour of the applications. I think more to the point, as we discussed the environment, it became apparent that the majority of developers had very little understanding &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;TDD&lt;/a&gt; and the benefits it can bring to your project.  &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Given the environment, my friend and I discussed a number of options that he could take forward in terms of educating the team in the ways of TDD and primarily some way of obtaining some level of test coverage of the application code. It was the later thread that &lt;a href="http://en.wikipedia.org/wiki/Electrostatic_discharge#Sparks"&gt;&lt;u&gt;sparked&lt;/u&gt;&lt;/a&gt; an interesting conversation about conceptualising a test and how you can get increase coverage from a small number of tests. He had explained that the architecture was fairly standard with a complex model that uses &lt;a href="http://www-128.ibm.com/developerworks/webservices/library/ws-soa-granularity/"&gt;&lt;u&gt;fine-grained&lt;/u&gt;&lt;/a&gt; interfaces for business entities wrapped up with a &lt;a href="http://www-128.ibm.com/developerworks/webservices/library/ws-soa-granularity/"&gt;&lt;u&gt;coarse-grained&lt;/u&gt;&lt;/a&gt; interface that is exposed to the UI. &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="218" alt="" width="396" src="http://www.ontheblog.net/CMS/Portals/0/Images/fine-vs-coarse.gif" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Discussing the split between UI code and service/business code it seemed there was approximately 30/70 split. Therefore, we both felt the best place to start would be at the service contract layer. The service contract provides a single point of access into a complex system. This is a very key point, what it essentially means is that by using the service contract and multiple data scenarios we can cover large portions of code within the complex model. To help developers visualise this concept, we talked through a few analogies that would fit.  Below are 3 visualisations of this.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p align="center"&gt;&lt;img height="300" width="400" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/lightning9.jpg" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;Lightning Forks&lt;/strong&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="212" width="224" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/ants.jpg" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;Ants nest paths&lt;/strong&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;&lt;img height="206" width="259" alt="" src="http://www.ontheblog.net/CMS/Portals/0/Images/tree-roots.gif" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;strong&gt;Tree root system&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;As you can see, each of these images can be used to visualise the many branches of code that could possibly be taken from the top down entry point. Exploring these different paths takes a multitude of data scenarios. Each data scenario being passed into the top level entry point results in decisions being made on that data at each possible branch. Therefore theoretically, albeit unlikely, you could write 1 test for an service contract method that could be re-run many many times with different inputs and attain 100% coverage of the branches below.   Validating key state data on exit of these test runs can help enforce the behaviour of the system and identify issues that may arise from developers not being able to see the impact of their changes.  Its not ideal, but it is an option.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Human’s by nature react well to the &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Visualization_%28graphic%29"&gt;visualisation&lt;/a&gt; of abstract concepts, it helps us comprehend complex intangible systems that other species have (so far) failed to master. They say a picture says a thousand words, I am thinking it could be a lot more. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;I&lt;/span&gt;&lt;span style="font-size: 9pt"&gt;n the case of the applications my friend needs to maintain, where no tests currently exist, this approach provides a valuable step in the right direction. It helps educate the developers who have not had to worry about testing before, as well as the additional advantage of  moving towards building important quality checks within the applications.  &lt;/span&gt;&lt;span style="font-size: 9pt"&gt;I am planning to catch up with my friend for beers in a few weeks time so I will update you to see how he is getting on. &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/11/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/11/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=11</guid>
      <pubDate>Mon, 18 Feb 2008 19:56:16 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=11</trackback:ping>
    </item>
    <item>
      <title>NHibernate and Tight Coupling</title>
      <description>&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;So, I'm half way through the week and had a chance to reflect on all the information I absorbed at the &lt;a href="http://www.altnetuk.com/"&gt;UK Alt.net conference&lt;/a&gt; last weekend. There were 4 sessions I attended during the day and the 3&lt;sup&gt;rd&lt;/sup&gt; session was titled “&lt;a href="http://en.wikipedia.org/wiki/NHibernate"&gt;NHibernate&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Linq"&gt;Linq&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Object-relational_mapping"&gt;ORM&lt;/a&gt;”. Out of all the sessions I attended, this was probably the largest. The majority of attendees of this session were NHibernate advocates. For me, when it comes to NHibernate the jury is still out, the following article describes one of the reasons why.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt"&gt;Some Background&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Just to give you some background, I have been using NHibernate in-depth on a project for the last 9 months. I am no expert in the field but no novice either. Before using and ORM tool, I would write &lt;a href="http://en.wikipedia.org/wiki/Stored_procedures"&gt;stored procedures&lt;/a&gt; in order to access &lt;a href="http://en.wikipedia.org/wiki/Create%2C_read%2C_update_and_delete"&gt;crud&lt;/a&gt; functions of the database. Actually, “writing stored procedures” is overstretching, I would use codegen tools, run them over the database and plug my code into the resulting assembly.  This was cool for a number of reasons, firstly the output assembly would show any changes or conflicts in code at compile time, and secondly it defined an explicit contract with my data store. I’m big on scaffolding in code (I know its not 100% &lt;a href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;TDD&lt;/a&gt;) but it provides a great way to visualise your overall code architecture. &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;When I started working on the project, I had very little exposure to ORM tools. I had read blog posts &amp; articles but had never really cut my teeth on the technology. I would say that in the .net world, NHibernate is probably the no 1 ORM tool available. NHibernate is a port of the java implementation Hibernate which has been popular for many years. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;The thinking behind ORM tools is that they “become the database” and that you really don’t need to waste time writing &lt;a href="http://en.wikipedia.org/wiki/SQL"&gt;SQL&lt;/a&gt; anymore. I have to say, the moment I started reading about ORM tools I felt a little uneasy. SQL is a language I am very comfortable with, more to the point it has been specifically developed in order to query data in a mathematical and consistent way. The idea of not touching SQL and focusing purely in code seemed a little frightening to me.  Trying to put my fears aside, I joined the project and jumped two feet into NHibernate.&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt"&gt;The Learning Curve&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;&lt;span style="font-size: 9pt"&gt;Now during the last 9 months I can honestly say that the NHibernate learning curve can be a little erratic. Initially the model seems simple with a mapping file connecting your entities to the database. But as you continue, issues such as &lt;a href="http://en.wikipedia.org/wiki/Inheritance_%28computer_science%29"&gt;inheritance&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming"&gt;polymorphism&lt;/a&gt; &amp; &lt;a href="http://en.wikipedia.org/wiki/Lazy_load"&gt;lazy loading&lt;/a&gt; all start to impact your productivity.  Now let me make it clear, all those issues can be solved with NHibernate in an elegant way, however finding that way takes time. One of the biggest problems I faced was an issue with entities that did not require to be saved. See the model below. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;p align="center"&gt;&lt;img alt="" width="600" height="208" src="http://www.ontheblog.net/CMS/Portals/0/model_hibernate_entity.gif" /&gt;&lt;/p&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;In this model we have all objects connected in a parent-child fashion. In this case the selected class which does not have a related database table, controls access into our complex system.  This posed a bit of an issue for me as Nhibernate infers saving via a mapping file and in this case the selected class does not exist in the parent mapping file. Therefore, I felt I had run into an &lt;a href="http://en.wikipedia.org/wiki/Object-relational_impedance_mismatch"&gt;Object/Relational Impedance mismatch&lt;/a&gt;. Again, it was just my understanding of NHibernate, I soon found that I could solve this problem using &lt;a href="http://www.hibernate.org/hib_docs/nhibernate/html/components.html"&gt;NHibernate Components&lt;/a&gt;. So as you can tell, NHibernate is a large beast and it issues such as these that can really throw a spanner in your productivity. But they are not issues that cannot be resolved. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt"&gt;NHibernate’s inherent Tight coupling&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;As my confidence with NHibernate has grown, I have felt that most issues can be resolved, all you need is the knowledge. However, there is one issue that I feel NHibernate creates that cannot be resolved. As I mentioned previously, I used to use stored procedures to interact with my database. Stored procedures in my mind are great as they enforce a contract between application code and the database. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Recently however, I hear people at conferences make snide remarks about them, like they are some form of &lt;a href="http://en.wikipedia.org/wiki/Pollution"&gt;pollution&lt;/a&gt; in the their code. I find this reaction strange, everywhere else in our code we spend time make sure there are adequate layers in order to reduce complexity and shield us from breaking changes.  So why is it that I hear people turning their nose up at sprocs? The answer lies in the history of sprocs, I think many of us have experienced sprocs that may be 100’s or 1000’s of lines of code. These procedures are in essence business logic, it’s this bad habit that has forced us to abandon them. A decision I feel is incorrect. &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;What stored procedures really are are “&lt;a href="http://en.wikipedia.org/wiki/Service-oriented_architecture#Service_contract"&gt;service contracts&lt;/a&gt;”, regardless of bad practices implemented by devs or dba's in the past, they still serve a purpose in that they &lt;a href="http://en.wikipedia.org/wiki/Decouple"&gt;decouple&lt;/a&gt; the database schema from our application code. Its this important fact that I believe NHibernate misses and as a result leads to tight coupling between application code and the database schema. (Please note: I know NHibernate can use stored procs instead but I question the value NHibernate offers over codegen in the same situation).   &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Lets take a simple mapping file for an address entity (shown below)&lt;/span&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;span style="font-size: 9pt"&gt;&lt;img alt="" width="458" height="235" src="http://www.ontheblog.net/CMS/Portals/0/Images/hibernate_address_map.gif" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;In this mapping file, we can see that properties on our &lt;a href="http://en.wikipedia.org/wiki/Entity"&gt;entity&lt;/a&gt; map directly to database columns. This is the most common pattern used by developers working with NHibernate.  Now let’s jump forward.. say 6 months after our application has gone to production, I am a DBA and I need to restructure the Address table as new services are consuming that data or &lt;a href="http://www.sql-server-performance.com/articles/per/execution_plan_statistics_p1.aspx"&gt;execution plans&lt;/a&gt; are bringing the server to a halt.  I want to rename columns and move the notes field into a separate table specifically designed for notes data. I can do this via simple script, however what I do not realise (being the dba) is that I have an application that is tighly coupled to the address table. I have an issue where changing the database could break any number of applications that depend on the data. I just don’t know!! More importantly, the  developers who wrote the application are no longer around (written by a supplier perhaps). I don’t even know about the dependency FULLSTOP as I cannot see these application server that may sit in disparate regions. What we have effectively done is create a long dependancy &amp; support issue for our applications.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;We could look to resolve this issue by implementing our mapping file so that it points to a &lt;a href="http://www.odetocode.com/Articles/299.aspx"&gt;view&lt;/a&gt; rather than the table, this however will only go so far, updates and deletes may need to span many tables which will be impossible to implement via &lt;a href="http://www.odetocode.com/Articles/299.aspx"&gt;view&lt;/a&gt;.  &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size: 9pt"&gt;So what do we do?&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;The answer is not clear, NHibernate &amp; other ORM tools rely on mapping properties to database columns. This pattern results in tight coupling that makes applications suffer from a poor resistance to change.  We as developers cannot assume that the database is just for the application we are developing, data is a &lt;a href="http://en.wikipedia.org/wiki/Commodity"&gt;commodity&lt;/a&gt; and therefore commonly shared amongst multiple services, and the querying of that data may be good for one scenario but not the other. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt"&gt;Its seems ORM’s fall right into this hole, they offer us productivty but at a cost. As I said, the jury is still out for me as to whether the pro's out weight the cons but being aware is vitally important. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I have a number of other issues I have comne across since using ORM's and I will be looking to blog about these in the future.  &lt;/p&gt;
&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/10/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/10/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=10</guid>
      <pubDate>Wed, 05 Nov 2008 10:59:15 GMT</pubDate>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=10</trackback:ping>
    </item>
    <item>
      <title>Visual Studio Xmas tree settings</title>
      <description>&lt;p&gt;Most developers spend the majority of their day with their head stuck inside visual studio,  I’m no different, so as a result I like to customize my editor so that I am as comfortable as possible.  Its in this area i’m a little old fashioned. I can’t stand the default white colour settings that visual studio offers, therefore I spend quite some time tuning them so they meet my needs.  Below is an example my code windows in visual studio. I really like these settings and I feel it makes the code far more readable and items such as strings, numbers, operators, keywords and regions are all specifically coded.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="342" alt="" width="500" src="http://www.ontheblog.net/CMS/Portals/0/Images/codewindow.gif" /&gt;&lt;/p&gt;
&lt;p&gt;Many of my colleagues have commented that my settings make my code window look like a Christmas tree. So if your feeling like you want to be a little festive then you can grab them &lt;a href="http://www.ontheblog.net/CMS/LinkClick.aspx?fileticket=DFMsQZ9MQRc%3d&amp;tabid=73&amp;mid=437&amp;forcedownload=true"&gt;here&lt;/a&gt;.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/9/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/9/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=9</guid>
      <pubDate>Fri, 08 Feb 2008 15:55:53 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=9</trackback:ping>
    </item>
    <item>
      <title>Alt.Net UK Conference</title>
      <description>&lt;p&gt;&lt;span style="font-size: 9pt; font-family: "&gt;As some of you may know..... and some may not, I have been working with &lt;a href="http://www.conchango.com/Web/Public/Content/Home.aspx"&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;Conchango&lt;/font&gt;&lt;/u&gt;&lt;/a&gt; on a project for the last 9 months. The conchango guys are great to work with, so when they asked if I wanted to attend the &lt;a href="http://www.altnetuk.com/"&gt;&lt;u&gt;Alt.Net conference&lt;/u&gt;&lt;/a&gt; this weekend (as they were hosting it), I was chuffed as originally I had thought I had missed the registrations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; font-family: "&gt;The conference was broken up over two days. Friday was a meet and greet session in the evening, everyone gets the opportunity to propose a session that they would like covered on the Saturday. I was really impressed with the topics that were up for discussion, my two offerings were "&lt;a href="http://en.wikipedia.org/wiki/Declarative_programming"&gt;&lt;u&gt;Declarative Programming&lt;/u&gt;&lt;/a&gt; &amp; Testability" and "Why use &lt;a href="http://en.wikipedia.org/wiki/Object-relational_mapping"&gt;&lt;u&gt;ORM&lt;/u&gt;&lt;/a&gt;".&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; font-family: "&gt;After filling the whiteboard with post it notes, I was amazed to see just how many where were related to testing and general quality of development. Having defined a rough agenda for the Saturday, everyone headed off to the Bankside bar where we could get to know each other. I couldn't stay too long as getting home takes an hour and half and had been at work all day I was a little shattered.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; font-family: "&gt;Over the next week I will be updating you about the sessions I attended and some of the key conclusions I came to. Generally though, I thought the conference was a great success. I got to meet some fantastic people and validate my ideas against others... oh and play a little &lt;a href="http://en.wikipedia.org/wiki/Table_football"&gt;&lt;u&gt;table football&lt;/u&gt;&lt;/a&gt;. Many thanks must go to &lt;a target="_blank" href="http://codebetter.com/blogs/ian_cooper"&gt;Ian Cooper&lt;/a&gt;, &lt;a target="_blank" href="http://thoughtpad.net/alan-dean.html"&gt;Alan Dean&lt;/a&gt; and &lt;a target="_blank" href="http://blog.benhall.me.uk/"&gt;Ben Hall&lt;/a&gt; for great organisation. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/8/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/8/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=8</guid>
      <pubDate>Thu, 07 Feb 2008 10:57:52 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=8</trackback:ping>
    </item>
    <item>
      <title>Visual Studio Ribbon Bar</title>
      <description>&lt;p&gt;Last night I awoke around 3am in a state of panic. What you ask could be making me worry? The answer is simple.....&lt;/p&gt;
&lt;p&gt;Visual Studio implementing the Ribbon Bar  &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/confused_smile.gif" /&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img height="200" alt="" width="346" src="http://www.ontheblog.net/CMS/Portals/0/Images/OfficeExcelRibbon.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Lucky for me it was just a dream..........it was wasn't it?&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/7/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/7/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=7</guid>
      <pubDate>Thu, 07 Feb 2008 10:56:59 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=7</trackback:ping>
    </item>
    <item>
      <title>Is BizTalk as a product dead? </title>
      <description>&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;Last weekend I was at a wedding fair with my fiancée looking at the last remaining big things we need to get sorted for our wedding in August. While there, I ran into my brother in-law (to be) who is also getting married. As he works at my old company we naturally ended up talking shop. During this time  the girls were browsed for fairy dust or something. (I think it’s fair to say we aren't really there by choice. :-))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;So during our discussion he told me about his boss asking him to get some &lt;a href="http://www.microsoft.com/learning/mcp/default.mspx"&gt;&lt;u&gt;Microsoft certs&lt;/u&gt;&lt;/a&gt; and he had a choice between &lt;a href="http://www.microsoft.com/biztalk/default.mspx"&gt;&lt;u&gt;BizTalk&lt;/u&gt;&lt;/a&gt; and &lt;a href="http://www.microsoft.com/sharepoint/default.mspx"&gt;&lt;u&gt;SharePoint.&lt;/u&gt;&lt;/a&gt; At the time I said get the SharePoint certs as they are far more likely to get you a job in the future as SharePoint is generally more popular in the enterprise. After that I moved on and forgot about things.... until today.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;As I was going for a walk during my lunch time I started to think about Microsoft’s current strategy for BizTalk and how there seems to be this awkward situation now that &lt;a href="http://en.wikipedia.org/wiki/Windows_Workflow_Foundation"&gt;&lt;u&gt;windows workflow&lt;/u&gt;&lt;/a&gt; has arrived. Having worked with both WF and BizTalk it is clear where the difference are between the products. I have listed these below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;1.) BizTalk is the enterprise solution and can scale (albeit costly), workflow is not currently seen this way.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;2.) BizTalk comes with a set of adaptors/accelerators for EAI, workflow has &lt;a href="http://en.wikipedia.org/wiki/Windows_Communication_Foundation"&gt;&lt;u&gt;WCF&lt;/u&gt;&lt;/a&gt;, but custom formats such as &lt;a href="http://en.wikipedia.org/wiki/Electronic_Data_Interchange"&gt;&lt;u&gt;EDI &lt;/u&gt;&lt;/a&gt;are not backed in.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;3.) BizTalk provides sophisticated &lt;a href="http://en.wikipedia.org/wiki/Business_activity_monitoring"&gt;&lt;u&gt;BAM&lt;/u&gt;&lt;/a&gt;. Some work has been carried out to allow Workflows to integrate with BizTalk’s BAM but this can be considered just an integration point with BizTalk.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;4.) BizTalk comes with productivity tool like the mapper. &lt;a href="http://en.wikipedia.org/wiki/Xslt"&gt;&lt;u&gt;XSLT&lt;/u&gt;&lt;/a&gt; is still a rare skill and the mapper is not available for WF.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;5.) BizTalk has a sophisticated rules engine. Workflow does not.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;6.) BizTalk comes with Health and Activity monitoring.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;Although there are many additional enterprise features that BizTalk has offer over WF, there is one issue and that needs to be addressed. That is, that Microsoft now has two retail workflow/orchestration engines. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;Having two workflow engine technologies is just not right, and Microsoft has recognised that. As a result  WF is due to be integrated into future versions of the BizTalk product.  However doing so raises a number of questions around the value of BizTalk as a product on its own right.  If WF provides the core orchestrations (which is really the selling point of BizTalk) then surely the other features of BizTalk are just extension to WF?  &lt;/span&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;&lt;strong&gt;Sample design surface for WF below&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p align="center"&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;&lt;img alt="" width="477" height="495" src="http://www.ontheblog.net/CMS/Portals/0/Images/workflow.jpg" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;I am not sure in what way Microsoft will distinguish BizTalk from WF, but &lt;u&gt;my thoughts are that the product will be reduced to a set of WF extensions for the enterprise&lt;/u&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;I just hope in the not too distant future that the BizTalk runtime/hosting service will become part of WF core services. Doing so will increase WF adoption dramatically.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'Arial','sans-serif'; font-size: 9pt"&gt;&lt;o:p&gt;&lt;a target="_blank" href="http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/68/Default.aspx"&gt;&lt;font style="background-color: #ffff00"&gt;Update post here!&lt;/font&gt;&lt;/a&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/6/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/6/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=6</guid>
      <pubDate>Fri, 08 Feb 2008 15:51:18 GMT</pubDate>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=6</trackback:ping>
    </item>
    <item>
      <title>70-502, 70-503, 70-54 Microsoft .net 3.5 Certification</title>
      <description>&lt;p&gt;So last year I updated my MCSD to the .net 2.0 certifications that included features such as generics etc. I left that update a little late in the day as I had not really had a need to update them and they felt like small extensions to the 1.1 certs I had already achieved.&lt;/p&gt;
&lt;p&gt;Over the last year and half I have been workign with .NET 3.0 technolgies, 3.0 brings a raft of new technolgies to the developer. The 3 core technolgoy center pieces being WPF, WF and WCF.&lt;/p&gt;
&lt;p&gt;As a result I have been eagerly awaiting the .net 3.0 exams in order to keep my certification up to date. It seems however microsoft have decided to skip by 3.0 certs and go straight to 3.5. Either way I'm happy and I will be boooking myself in in the not too distant future.&lt;/p&gt;
&lt;p&gt;Exam 70-502 Microsoft .NET Framework 3.5 - Windows Presentation Foundation. Expected to be released in February 2008. &lt;a href="http://www.microsoft.com/learning/exams/70-502.mspx"&gt;http://www.microsoft.com/learning/exams/70-502.mspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Exam 70-503 Microsoft .NET Framework 3.5 - Windows Communication Foundation. Expected to be released in February 2008. &lt;a href="http://www.microsoft.com/learning/exams/70-503.mspx"&gt;http://www.microsoft.com/learning/exams/70-503.mspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Exam 70-504 Microsoft .NET Framework 3.5 - Windows Workflow Foundation. Expected to be released in March 2008.  &lt;a href="http://www.microsoft.com/learning/exams/70-504.mspx"&gt;http://www.microsoft.com/learning/exams/70-504.mspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/5/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/5/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=5</guid>
      <pubDate>Thu, 07 Feb 2008 10:56:15 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=5</trackback:ping>
    </item>
    <item>
      <title>3.5 .Net Framework Souce Release</title>
      <description>&lt;div&gt;Over the weekend I had a play with the new .NET framework source code release which now allows you to debug into framework classes as part of your standard debugging. The source gives a good insight into how classes have been built and can often help in understanding their behaviour. Also it comes with the original comments which can be quite enlightening.  You can only do this from visual studio 2008 and most of the .net framework including WPF can be debugged.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Info for setting it up can be found here &lt;a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx"&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Couple of funny comments in the code that I found from initial play below.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;                &lt;span style="color: #c0504d"&gt;Optimistic developer&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;                    // Note: This doesn't work on Win9x.  We can implement this&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;                    // functionality on Win9x by writing a 16 bit DLL and &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;                    // calling the LAN Manager method NetWkstaGetInfo().  See &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;                    // &lt;a href="http://support.microsoft.com/support/kb/articles/Q155/6/98.asp"&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;http://support.microsoft.com/support/kb/articles/Q155/6/98.asp&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;                    // We don't have the time to implement this in V1. Hopefully &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;                    // by the time V2 rolls around, everyone will run Windows XP.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;      &lt;span style="color: #c0504d"&gt;Hacking is part and parcel of the MS Job. &lt;/span&gt;&lt;span style="color: #c0504d"&gt;J&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;        // HACK HACK HACK - when we change RightToLeft, we need to change the scrollbar thumb. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;        // We can't do that until after the control has been created, and all the items added&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;        // back. This is because the system control won't know the nMin and nMax of the scroll &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;        // bar until the items are added. So in RightToLeftChanged, we set a flag that indicates&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;        // that we want to set the scroll position. In OnHandleCreated we check this flag,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;        // and if set, we BeginInvoke. We have to BeginInvoke since we have to wait until the items&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;        // are added. We only want to do this when RightToLeft changes thus the flags &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color: #548dd4"&gt;        // STATE2_HAVEINVOKED and STATE2_SETSCROLLPOS. Otherwise we would do this on each&lt;/span&gt;&lt;/div&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/4/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/4/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=4</guid>
      <pubDate>Thu, 07 Feb 2008 10:55:06 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=4</trackback:ping>
    </item>
    <item>
      <title>WPF text trimming</title>
      <description>&lt;p&gt;Here’s a useful tip for you budding WPF aficionados out there.  If there is any chance that the text in a textblock may become truncated (the databound text may not fit or the window may be resized), assuming you don’t want the text to wrap (where you would use the TextWrapping attribute), add the TextTrimming attribute.  Your options are None (no ellipse – default), WordEllipse (an ellipse is inserted after the last word that fits) or CharacterEllipse (an ellipse is inserted after the last character that fits).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example from MSDN&lt;/strong&gt;&lt;/p&gt;
&lt;pre id="ctl00_rs1_mainContentContainer_ctl60XAML" space="preserve"&gt;&lt;span style="color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;TextBlock&lt;/span&gt; 
  Name="myTextBlock" 
  Margin="20" Background="LightGoldenrodYellow" 
  TextTrimming="CharacterEllipse" TextWrapping="NoWrap"
  FontSize="14"
&lt;span style="color: blue"&gt;&gt;&lt;/span&gt;
  One&lt;span style="color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;LineBreak/&lt;/span&gt;&lt;span style="color: blue"&gt;&gt;&lt;/span&gt;
  two two&lt;span style="color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;LineBreak/&lt;/span&gt;&lt;span style="color: blue"&gt;&gt;&lt;/span&gt;
  Three Three Three&lt;span style="color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;LineBreak/&lt;/span&gt;&lt;span style="color: blue"&gt;&gt;&lt;/span&gt;
  four four four four&lt;span style="color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;LineBreak/&lt;/span&gt;&lt;span style="color: blue"&gt;&gt;&lt;/span&gt;
  Five Five Five Five Five&lt;span style="color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;LineBreak/&lt;/span&gt;&lt;span style="color: blue"&gt;&gt;&lt;/span&gt;
  six six six six six six&lt;span style="color: blue"&gt;&lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;LineBreak/&lt;/span&gt;&lt;span style="color: blue"&gt;&gt;&lt;/span&gt;
  Seven Seven Seven Seven Seven Seven Seven
&lt;span style="color: blue"&gt;&lt;span style="color: maroon"&gt;TextBlock&lt;/span&gt;&lt;span style="color: blue"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Results in&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="130" alt="" width="104" src="http://www.ontheblog.net/CMS/Portals/0/ms605785_TextTrimming_Character(en-us,VS_90).png" /&gt;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/3/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/3/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=3</guid>
      <pubDate>Thu, 07 Feb 2008 10:49:52 GMT</pubDate>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=3</trackback:ping>
    </item>
    <item>
      <title>WPF Bug... ListView within a Listbox</title>
      <description>&lt;p align="left"&gt;I was recently having issues with a XAML structure I was working on. The stucture of my XAML was as follows.&lt;/p&gt;
&lt;p align="left"&gt;&lt;strong&gt;&lt;font style="background-color: #ffff00"&gt;LISTBOX (Bound to collection of custom objects)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;p align="left"&gt;&lt;strong&gt;&lt;font style="background-color: #ffff00"&gt;{Item Template}&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;&lt;blockquote dir="ltr" style="margin-right: 0px"&gt;
&lt;p align="left"&gt;&lt;strong&gt;&lt;font style="background-color: #ffff00"&gt;ListView (Bound to Collection of Child Objects that hangs of the Parent binding)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;p align="left"&gt;Now when I ran the app I got the binding firing for each parent and associated child collection but when the xaml renders only the first listboxitem has a listview bound below it. Is this a bug in the way ListViews work when nested within a Listbox's data template?&lt;/p&gt;
&lt;p align="left"&gt;The answer it turns out is a big &lt;font size="4"&gt;YES&lt;/font&gt;. Apparently, this is a know issue in WPF. In order to resolve this issue you need to make sure that all your datatemplates are moved to resources. Only then will the databinging and rendering work.&lt;/p&gt;
&lt;p align="left"&gt;My XAML is show below for reference.&lt;/p&gt;
&lt;p&gt;&lt;font color="#a31515" size="2"&gt;Window&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; x&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;Class&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="WpfApplication1.Window1" &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;xmlns&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/a&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;xmlns&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;:&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;x&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/a&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;Title&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="Window1"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Height&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="300"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Width&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="300" &gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;StackPanel&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; VerticalAlignment&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="Stretch" &gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Button&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Click&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="Button_Click"&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Run Test&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Button&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListBox&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Name&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="ParentListBox"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; VerticalAlignment&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="Stretch"&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListBox.ItemTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;DataTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;StackPanel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Border&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; BorderThickness&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="1"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; BorderBrush&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="Black"&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;StackPanel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;TextBlock&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Height&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="25"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Text&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="{&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Binding&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Path&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=ParentName}"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;TextBlock&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListView&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; ItemsSource&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="{&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Binding&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Path&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=Children}"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Margin&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="0"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Name&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="SubList"&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListView.ItemContainerStyle&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Style&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; TargetType&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="ListViewItem"&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Setter&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Property&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="HorizontalContentAlignment"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Value&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="Stretch" /&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Style&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListView.ItemContainerStyle&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListView.View&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;GridView&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;GridView.Columns&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;GridViewColumn&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Width&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="300"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Header&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="Child"&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;GridViewColumn.CellTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;DataTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;TextBlock&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Text&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="{&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Binding&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; Path&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=ChildName}"&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt; TextWrapping&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="Wrap"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;TextBlock&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;DataTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;GridViewColumn.CellTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;GridViewColumn&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;GridView.Columns&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;GridView&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListView.View&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListView&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;StackPanel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;Border&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;StackPanel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;DataTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListBox.ItemTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListBox.ItemsPanel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ItemsPanelTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;StackPanel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; /&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ItemsPanelTemplate&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListBox.ItemsPanel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;ListBox&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt; &lt;br /&gt;
&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;StackPanel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&gt;&lt;/&lt;font color="#a31515"&gt;Window&lt;/font&gt;&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;&lt;/p&gt;
&lt;p align="left"&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/2/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/2/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=2</guid>
      <pubDate>Thu, 07 Feb 2008 10:49:52 GMT</pubDate>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=2</trackback:ping>
    </item>
    <item>
      <title>DotnetNuke the great platform.</title>
      <description>&lt;p&gt;Started created my new site with &lt;a href="http://www.DotNetNuke.com"&gt;DNN&lt;/a&gt;. I have used this product for years now and it keeps getting better. I have worked on many large scale enterprise implementation using the platform and I am hoping to blog about some of the issues you have when trying to scale the platform. As for my site its just going to be a place for me to blog so hopefully I wont need to concern myself with these matters! &lt;img alt="" src="http://www.ontheblog.net/CMS/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/wink_smile.gif" /&gt; Below are some the sites I have developed previously.&lt;/p&gt;
&lt;p align="left"&gt;&lt;a href="http://www.Hiscox.de"&gt;www.hiscox.de&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;a href="http://business.hiscox.co.uk/"&gt;business.hiscox.co.uk&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;a href="http://www.insurex.co.uk"&gt;www.insurex.co.uk&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt; &lt;a href="http://www.glynoldboys.com"&gt;www.glynoldboys.com&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;a href="http://www.hiscox.fr"&gt;www.hiscox.fr&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;a href="http://www.ontheblog.net"&gt;www.ontheblog.net&lt;/a&gt;&lt;/p&gt;
&lt;p align="left"&gt; &lt;/p&gt;</description>
      <link>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/1/Default.aspx</link>
      <comments>http://www.ontheblog.net/CMS/Home/tabid/36/EntryID/1/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.ontheblog.net/CMS/Default.aspx?tabid=36&amp;EntryID=1</guid>
      <pubDate>Thu, 07 Feb 2008 10:49:52 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.ontheblog.net/CMS/DesktopModules/Blog/Trackback.aspx?id=1</trackback:ping>
    </item>
  </channel>
</rss>
