﻿<?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>Thu, 07 Aug 2008 21:29:20 GMT</pubDate>
    <lastBuildDate>Thu, 07 Aug 2008 21:29:20 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.3.0.16726</generator>
    <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</title>
      <description>&lt;p&gt;I was having think about fluent language interfaces and got me thinking about the power they can offer. Take this example for searching the web. &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>Mon, 14 Jul 2008 20:57:27 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>1</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=mscor