<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
    <title>Ian Blackburn</title>
    <link rel="self" type="application/atom+xml" href="http://bbits.co.uk/blog/Atom.aspx" />
    <subtitle type="html">I've got blisters on my fingers...</subtitle>
    <id>http://bbits.co.uk/blog/Default.aspx</id>
    <author>
        <name>Ian Blackburn</name>
        <uri>http://bbits.co.uk/blog/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 2.0.0.43">Subtext</generator>
    <updated>2008-12-17T19:03:30Z</updated>
    <entry>
        <title>Silverlight Drag and Drop and HitTest on any layout (not just Canvas)</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/12/17/silverlight-drag-and-drop-and-hittest-on-any-layout-not.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/12/17/silverlight-drag-and-drop-and-hittest-on-any-layout-not.aspx</id>
        <published>2008-12-17T19:03:30Z</published>
        <updated>2008-12-17T19:03:30Z</updated>
        <content type="html">&lt;p&gt;&lt;em&gt;&lt;strong&gt;[Cross Posted from &lt;/strong&gt;&lt;/em&gt;&lt;a href="http://silverlightforbusiness.net"&gt;&lt;em&gt;&lt;strong&gt;http://silverlightforbusiness.net&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;&lt;em&gt;&lt;strong&gt; ]&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;A common requirement for a rich UI in a business application is to support dragging and dropping of UI elements.  For this to be successful you will need to be able to detect what elements you are dragging over, and you will need to support dragging over any type of layout (such as a complex grid layout), which is a contrast to many examples out there that only show dragging and dropping in relation to absolute layout with a Canvas.&lt;/p&gt;  &lt;p&gt;In addition many blogs appear to mention that the UIElement.HitTest method, available in beta’s of Silverlight 2, has since disappeared.  However we have the VisualTreeHelper.FindElementsInHostCoordinates method instead that can perform a point hittest for us (that is it will return the elements a point is inside).&lt;/p&gt;  &lt;p&gt;So to that end I have created a simple DragManager class that makes it easy to make any element draggable, and raises events when the dragged element collides with one or more elements.&lt;/p&gt;  &lt;p&gt;To use the DragManager simply add the class to your project, create an instance of it, wire up the collision event and call EnableDragableElement on the elements you want to drag.  Note that since this uses the MouseLeftButtonDown, Move and Up events, any control that handles these events internally will not work (e.g. the Button).&lt;/p&gt;  &lt;div&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;DragManager dm = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DragManager(LayoutRoot);
dm.Collision+= dm_Collision;
dm.EnableDragableElement(Ellipse1);
dm.EnableDragableElement(TextBlockStatus);
dm.EnableDragableElement(Image1);&lt;/pre&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt; dm_Collision(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, CollisionEventArgs e)
{
    TextBlockStatus.Text = ((FrameworkElement)e.Element).Name + &lt;span style="color: #006080"&gt;" "&lt;/span&gt; + e.Position.X + &lt;span style="color: #006080"&gt;","&lt;/span&gt; + e.Position.Y + &lt;span style="color: #006080"&gt;": "&lt;/span&gt;;
    &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (UIElement element &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; e.CollidedElements)
    {
        TextBlockStatus.Text += ((FrameworkElement)element).Name + &lt;span style="color: #006080"&gt;" "&lt;/span&gt;;
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Of the interesting methods in the DragManager, the following performs the move for the element, and uses a TranslateTransform to move the element.  This is in contrast to many examples which use the Canvas.Top and Canvas.Left properties, and has the benefit of working with any layout.&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt; elementToDrag_MouseMove(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, MouseEventArgs e)
{
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (isDragging)
    {
        UIElement element = (UIElement)sender;
        TranslateTransform transform = GetTranslateTransform(element);
        Point currentMousePosition = e.GetPosition(layoutRoot);
        &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; mouseX = currentMousePosition.X - lastMousePosition.X;
        &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; mouseY = currentMousePosition.Y - lastMousePosition.Y;
        transform.X += mouseX;
        transform.Y += mouseY;
        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Collision != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
        {
            List&amp;lt;UIElement&amp;gt; collidedElements = 
                VisualTreeHelper.FindElementsInHostCoordinates(
                    currentMousePosition, layoutRoot) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; List&amp;lt;UIElement&amp;gt;;
            collidedElements.Remove(element);
            collidedElements.Remove(layoutRoot);

            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (collidedElements.Count() &amp;gt; 0)
            {
                CollisionEventArgs args = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; CollisionEventArgs() 
                    {   Element = element, 
                        Position = currentMousePosition, 
                        CollidedElements = collidedElements };
                Collision(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, args);
            }
        }
        lastMousePosition = currentMousePosition;

    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;This method calls GetTranslateTransform which looks for an existing TranslateTransform on the element or adds one if not present.&lt;/p&gt;

&lt;p&gt;It also calls the VisualTreeHelper.FindElementsInHostCoordinates method to determine if a collision has taken place.  We need to remove the layout root and the element we are dragging since they will always be returned.&lt;/p&gt;

&lt;p&gt;Full source is available &lt;a target="_blank" href="http://cid-fb8b852ef1ab0b35.skydrive.live.com/self.aspx/SampleCode/SilverlightDragNDrop.zip"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;

&lt;p&gt;Ian&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4c3bddad-dbe0-46b0-b8a1-82860a78ebcc" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/HitTest" rel="tag"&gt;HitTest&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Drag+and+Drop" rel="tag"&gt;Drag and Drop&lt;/a&gt;&lt;/div&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16885.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://bbits.co.uk/blog/comments/16885.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://bbits.co.uk/blog/comments/commentRss/16885.aspx</wfw:commentRss>
        <trackback:ping>http://bbits.co.uk/blog/services/trackbacks/16885.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Skydrive &amp;ndash; now no Windows ID required to collect files</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/12/12/skydrive-ndash-now-no-windows-id-required-to-collect-files.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/12/12/skydrive-ndash-now-no-windows-id-required-to-collect-files.aspx</id>
        <published>2008-12-12T10:09:22Z</published>
        <updated>2008-12-12T10:09:22Z</updated>
        <content type="html">&lt;p&gt;This little checkbox is a welcome addition for me:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="image" border="0" alt="image" src="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/SkydrivenownoWindowsIDrequiredtocollectf_8E06/image_394ab897-4715-4e32-b83c-e1c53cfa99ad.png" width="392" height="53" /&gt; &lt;/p&gt;  &lt;p&gt;It means that I can share files on a Skydrive and not require recipients to have a Windows Live ID, which was occasionally a problem before,&lt;/p&gt;  &lt;p&gt;25GB is available for free now too &lt;a target="_blank" href="http://uk.youtube.com/watch?v=puMbqfs98JI"&gt;which is nice&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4c809dae-b579-49fc-a3d5-8a119260e4f5" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Skydrive" rel="tag"&gt;Skydrive&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Windows+Live" rel="tag"&gt;Windows Live&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;Ian&lt;/p&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16884.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://bbits.co.uk/blog/comments/16884.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://bbits.co.uk/blog/comments/commentRss/16884.aspx</wfw:commentRss>
        <trackback:ping>http://bbits.co.uk/blog/services/trackbacks/16884.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Working with Data in Silverlight 2 (Entity Framework, Ado.Net Data Services, and DataGrid)</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/12/07/working-with-data-in-silverlight-2-entity-framework-ado.net-data.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/12/07/working-with-data-in-silverlight-2-entity-framework-ado.net-data.aspx</id>
        <published>2008-12-07T18:48:51Z</published>
        <updated>2008-12-07T18:57:24Z</updated>
        <content type="html">&lt;p&gt;&lt;em&gt;[Cross posted from: &lt;/em&gt;&lt;a href="http://silverlightforbusiness.net"&gt;&lt;em&gt;SilverlightForBusiness.net&lt;/em&gt;&lt;/a&gt;&lt;em&gt; ]&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Since &lt;a href="http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx"&gt;the announcement from Tim Mallalieu&lt;/a&gt; (Program Manager, LINQ to SQL and Entity Framework) that “as of NET 4.0 the Entity Framework will be our recommended data access solution for LINQ to relational scenarios” your first decision on how to get data into and out of your databases has been made easier: EF is the way to go when looking at solutions from Microsoft (of course you may still decide that you would prefer to use something else from a third party, perhaps &lt;a href="http://www.llblgen.com"&gt;LLBLGEN&lt;/a&gt;, or maybe a hand crafted solution?).&lt;/p&gt;
&lt;p&gt;But after that decision you still have another before we get the data anywhere Silverlight – how to “surface” or expose it.  Here you could use a WCF service with a basicHttpBinding a-la the “Silverlight enabled wcf service” template offered to us by Visual Studio 2008 with the Silverlight tools installed. &lt;/p&gt;
&lt;p&gt;However a more interesting approach and one that appears to be a better fit with the way Alexandria (i.e. Silverlight 3) will work is to use an &lt;a href="http://msdn.microsoft.com/en-us/data/bb931106.aspx"&gt;Ado.Net Data Service&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So what is an Ado.Net Data Service?  The &lt;a href="http://msdn.microsoft.com/en-gb/library/cc956153.aspx"&gt;documentation&lt;/a&gt; provides an nice summary:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The goal of the ADO.NET Data Services framework is to facilitate the creation of flexible data services that are naturally integrated with the web. As such, ADO.NET Data Services use URIs to point to pieces of data and simple, well-known formats to represent that data, such as JSON and ATOM (XML-based feed format). This results in the data service being surfaced as a REST-style resource collection that is addressable with URIs and that agents can interact with using standard HTTP verbs such as GET, POST, PUT or DELETE.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So that means that we can surface our data very simply via a &lt;a target="_blank" href="http://en.wikipedia.org/wiki/REST"&gt;REST&lt;/a&gt; interface.  Bottom line – you don’t have to write a whole load of methods in your service such as GetProducts, GetProductsById, GetOrder(int Id), UpdateOrder etc etc.  Instead you simple expose your data model through the service.&lt;/p&gt;
&lt;p&gt;At this point I usually hear a gasp of belief – “what all our data is available read/write over the web?” – erm yes, but only if you choose not to lock it down.  Ado.Net Data Services combined with the EF give you plenty of scope to control access to data based on a users authentication and to inject business and validation logic.  But that is a blog post for another time.&lt;/p&gt;
&lt;p&gt;What I think is particularly interesting from Silverlight when you use this combination of EF and ADO.Net Data Services is that the code you write feels as if you are writing it on the same tier as the database and application logic – in fact, it is not much different, and that is quite compelling.  It makes the classic find data, edit it with business logic applied, and sent back to the database quite easy (with a few gotcha’s which I will list below)&lt;/p&gt;
&lt;p&gt;When I show this to delegates on a course who are used to using the Asp.Net Datagrid it gets another gasp, but this time in a positive way (well maybe not a gasp -  but certainly a look of bewilderment that belies the effort that have had to put into doing the same thing in Asp.net previously).&lt;/p&gt;
&lt;p&gt;Ok so lets see a little code – I am going to demonstrate editing data from the Products table in the Northwind sample database.&lt;/p&gt;
&lt;p&gt;I created a Silverlight Project then added a Ado.Net Entity Data Model to the web site and used the Wizard to add all the tables in the Northwind database to it. At this point you will most likely want to at least add some validation logic, or for more complex systems, extend the model.  I will cover this is later posts, but for now you can get more info on using EF from &lt;a href="http://cid-245ED00EDB4C374E.profile.live.com"&gt;zeeshanhirani&lt;/a&gt;'s free &lt;a href="http://cid-245ed00edb4c374e.skydrive.live.com/redir.aspx?page=self&amp;amp;resId=245ED00EDB4C374E!132"&gt;entity framework learning guide.pdf&lt;/a&gt;  including a walkthrough on this very item.  The &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/bb399572.aspx"&gt;msdn documentation&lt;/a&gt; is getting better too.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_2.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" width="603" height="484" src="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_thumb.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Next we add an Ado.Net Data Service to the web site and configure it to use our Entities type (in this case NorthwindEntities).  Also in the example below I have allowed full read/write access to all the data in the model (gasp!).  For more info on controlling access to the entities see the &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/data/bb931106.aspx"&gt;msdn documentation&lt;/a&gt; and I will be blogging about this in more details later.&lt;/p&gt;
&lt;div&gt;
&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;class&lt;/span&gt; NorthwindDataService : DataService&amp;lt; &lt;strong&gt;NorthwindEntities&lt;/strong&gt; &amp;gt;
{
    &lt;span style="COLOR: #008000"&gt;// This method is called only once to initialize service-wide policies.&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;public&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;static&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt; InitializeService(IDataServiceConfiguration config)
    {
        &lt;span style="COLOR: #008000"&gt;// TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.&lt;/span&gt;
        &lt;span style="COLOR: #008000"&gt;// Examples:&lt;/span&gt;
         config.SetEntitySetAccessRule(&lt;span style="COLOR: #006080"&gt;"*"&lt;/span&gt;, EntitySetRights.All);
         config.SetServiceOperationAccessRule(&lt;span style="COLOR: #006080"&gt;"*"&lt;/span&gt;, ServiceOperationRights.All);
    }
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Ok we have our data available.  At this point you can browse the svc file and see your data exposed as ATOM.  &lt;/p&gt;
&lt;p&gt;&lt;a href="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_4.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" width="646" height="772" src="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_thumb_1.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;You can try navigating through the data by using the Url.  For example try the following (changing the port to your own web site of course :-) &lt;/p&gt;
&lt;p&gt;&lt;a href="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_8.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" width="696" height="382" src="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_thumb_3.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_10.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" width="697" height="457" src="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_thumb_4.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_12.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" width="698" height="432" src="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_thumb_5.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Although this looks like read-only data, the service supports updates too through other HTTP verbs (e.g PUT).  So lets put that to the test by adding a service reference to Silverlight and creating an editable grid for the Products table (we will just edit one column for reasons that will become clear).&lt;/p&gt;
&lt;p&gt;In the Silverlight project select Add Service Reference, click Discover and give it appropriate name (e.g. NorthwindDataService).  This will build a proxy class for us that supports the Ado.Net Data Service in Silverlight.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_14.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" width="708" height="649" src="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_thumb_6.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;We are going to use the DataGrid to display and edit the data.  What we want to do is bind the data from our service to the DataGrid, use the grid to edit it, then send the changes back in a batch update.  Currently the DataGrid has a few issues, not least we do not have an event that lets us know when row data has been edited (this was available in beta’s of the grid but was removed in the final release – a strange decision, one that I would expect to be resolved sometime in the future).  To stack up another blog post with the others I have declared in this post, I will take a look at the free &lt;a target="_blank" href="http://www.devexpress.com/Products/NET/Components/Silverlight/Grid/"&gt;AgDataGrid from DevExpress&lt;/a&gt; in a later post which does not suffer from this.  We will work around this problem by using a DataTemplate and attaching to the LostFocus event of the TextBox that we will use to edit the data.  &lt;/p&gt;
&lt;p&gt;Here is the Xaml for our UI (if you can call it that – just a couple of buttons and a one column grid)&lt;/p&gt;
&lt;div&gt;
&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;Grid&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="LayoutRoot"&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Background&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="White"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;RowDefinition&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="30"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;RowDefinition&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="Auto"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;StackPanel&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Orientation&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="Horizontal"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;Button&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Content&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="Get data "&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Click&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="Button_Click"&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="5"&lt;/span&gt;  &lt;span style="COLOR: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;Button&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;Button&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Content&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="Save data "&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Click&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="Button_Click_1"&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Margin&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="5"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;Button&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;

    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGrid&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="DataGrid1"&lt;/span&gt;  &lt;span style="COLOR: #ff0000"&gt;AutoGenerateColumns&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="False"&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Grid&lt;/span&gt;.&lt;span style="COLOR: #ff0000"&gt;Row&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="1"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGrid.Columns&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;

            &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGridTemplateColumn&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Header&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="Product"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGridTemplateColumn.CellTemplate&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;TextBlock&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="{Binding ProductName, Mode=TwoWay}"&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;TextBlock&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGridTemplateColumn.CellTemplate&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGridTemplateColumn.CellEditingTemplate&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;TextBox&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;LostFocus&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="TextBox_LostFocus"&lt;/span&gt; &lt;span style="COLOR: #ff0000"&gt;Tag&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="{Binding ProductID}"&lt;/span&gt; &lt;br /&gt;                                 &lt;span style="COLOR: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;="{Binding ProductName, Mode=TwoWay}"&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;TextBox&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGridTemplateColumn.CellEditingTemplate&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGridTemplateColumn&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGrid.Columns&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;

    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;data:DataGrid&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;

&lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;Grid&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;In the code behind we will need to instantiate our service as a class scoped variable.  Notice that the constructor takes a Uri pointing to the svc file we want to use.&lt;/p&gt;
&lt;div&gt;
&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;NorthwindDataService.NorthwindEntities entities = &lt;br /&gt;                  &lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt; NorthwindDataService.NorthwindEntities(&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt; Uri(&lt;span style="COLOR: #006080"&gt;"NorthwindDataService.svc"&lt;/span&gt;,UriKind.Relative));&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We can then use the DataServicesQuery type to create and execute a query when the Get Data button is clicked.  Ideally we would just bind the results to the DataGrid, but this does not currently work, so instead I am also storing the results of the query in a List&amp;lt;Products&amp;gt; and binding that – this is really a hack to get around the DataGrid problem.&lt;/p&gt;
&lt;div&gt;
&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;span style="COLOR: #0000ff"&gt;private&lt;/span&gt; List&amp;lt;Products&amp;gt; loadedProducts;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;span style="COLOR: #0000ff"&gt;private&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt; Button_Click(&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
 {
     DataServiceQuery&amp;lt;Products&amp;gt; query = (DataServiceQuery&amp;lt;Products&amp;gt;)
         from c &lt;span style="COLOR: #0000ff"&gt;in&lt;/span&gt; entities.Products
         &lt;span style="COLOR: #0000ff"&gt;where&lt;/span&gt; c.Discontinued ==&lt;span style="COLOR: #0000ff"&gt;false&lt;/span&gt;
                 select c;
     DataGrid1.ItemsSource = &lt;span style="COLOR: #0000ff"&gt;null&lt;/span&gt;;
     query.BeginExecute(&lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt; AsyncCallback(c =&amp;gt;
     {
         IEnumerable&amp;lt;Products&amp;gt; results= query.EndExecute(c);
         loadedProducts = results.ToList();
         DataGrid1.ItemsSource = loadedProducts;
         
     }),query);

     
 }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Ok so when this button is clicked the DataGrid will show the result of the query using it’s DataTemplate:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_16.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" width="359" height="772" src="http://bbits.co.uk/blog/images/bbits_co_uk/blog/WindowsLiveWriter/WorkingwithDatainSilverlight2_D6D9/image_thumb_2.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Selecting a cell, then clicking again in it will switch the DataGrid it to edit mode (or you could double-click, but that’s not very web ui ;-).  After the data is edited we want to update our entity data with the changes.  Ideally the DataGrid would do this for us automatically, but unfortunately it does not at the moment, so instead we have hooked the LostFocus event on the textbox:&lt;/p&gt;
&lt;div&gt;
&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;&lt;span style="COLOR: #0000ff"&gt;private&lt;/span&gt; &lt;span style="COLOR: #0000ff"&gt;void&lt;/span&gt; TextBox_LostFocus(&lt;span style="COLOR: #0000ff"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
    
        &lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt; changedItemId = (&lt;span style="COLOR: #0000ff"&gt;int&lt;/span&gt;)((TextBox)sender).Tag;
        Products changedItem = (from c &lt;span style="COLOR: #0000ff"&gt;in&lt;/span&gt; loadedProducts
                                &lt;span style="COLOR: #0000ff"&gt;where&lt;/span&gt; c.ProductID == changedItemId
                                select c).Single();
        entities.UpdateObject(changedItem);
        

}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;You will notice that in the DataTemplate for the grid, I embedded the ID for the item in a tag property for the TextBox – I am using this to find the actual product data in the List&amp;lt;Products&amp;gt; we populated when we got the data.  We then call UpdateObject on our entities object and pass the updated item to it.  This has not made any call to the database at this point, just updated our –in-memory entities collection.&lt;/p&gt;
&lt;p&gt;Our Save Data event handler looks like the following, most of which is examining the OperationalResponses fro the Ado.Net Data service for exceptions.  The nice bit is that we only need to call BeginSaveChanges on our entities object to update all the changes in the database.&lt;/p&gt;
&lt;div&gt;
&lt;pre style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0px; LINE-HEIGHT: 12pt; BORDER-RIGHT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; MARGIN: 0em; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-TOP-STYLE: none; COLOR: black; FONT-SIZE: 8pt; BORDER-LEFT-STYLE: none; OVERFLOW: visible; PADDING-TOP: 0px"&gt;entities.BeginSaveChanges(SaveChangesOptions.ContinueOnError, &lt;span style="COLOR: #0000ff"&gt;new&lt;/span&gt; AsyncCallback(c =&amp;gt;
           {
               &lt;span style="COLOR: #0000ff"&gt;try&lt;/span&gt;
               {
                   DataServiceResponse response = entities.EndSaveChanges(c);
                   var operationalResponses = response.GetEnumerator();
                   &lt;span style="COLOR: #0000ff"&gt;while&lt;/span&gt; (operationalResponses.MoveNext() == &lt;span style="COLOR: #0000ff"&gt;true&lt;/span&gt;)
                   {
                       MessageBox.Show(operationalResponses.Current.StatusCode + &lt;span style="COLOR: #006080"&gt;" "&lt;/span&gt; + operationalResponses.Current.Error);
                   }
                   MessageBox.Show(&lt;span style="COLOR: #006080"&gt;"Saved"&lt;/span&gt;);
               }
               &lt;span style="COLOR: #0000ff"&gt;catch&lt;/span&gt; (DataMisalignedException ex)
               {
                   MessageBox.Show(&lt;span style="COLOR: #006080"&gt;"Misaligned "&lt;/span&gt; + ex.Message);
               }
               &lt;span style="COLOR: #0000ff"&gt;catch&lt;/span&gt; (DataServiceClientException ex)
               {
                   MessageBox.Show(&lt;span style="COLOR: #006080"&gt;"Client "&lt;/span&gt; + ex.Message);
               }
               &lt;span style="COLOR: #0000ff"&gt;catch&lt;/span&gt; (DataServiceRequestException ex)
               {
                   MessageBox.Show(&lt;span style="COLOR: #006080"&gt;"Request "&lt;/span&gt; + ex.Message);
                   var operationalResponses = ex.Response.GetEnumerator();
                   &lt;span style="COLOR: #0000ff"&gt;while&lt;/span&gt; (operationalResponses.MoveNext() == &lt;span style="COLOR: #0000ff"&gt;true&lt;/span&gt;)
                   {
                       &lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt; message = &lt;span style="COLOR: #0000ff"&gt;string&lt;/span&gt;.Empty;
                       &lt;span style="COLOR: #0000ff"&gt;if&lt;/span&gt; (operationalResponses.Current.Error != &lt;span style="COLOR: #0000ff"&gt;null&lt;/span&gt;)
                       {
                           message = operationalResponses.Current.Error.Message;
                       }
                       message += &lt;span style="COLOR: #006080"&gt;" Status code: "&lt;/span&gt; + operationalResponses.Current.StatusCode;
                       MessageBox.Show(message);
                   }
               }
               &lt;span style="COLOR: #0000ff"&gt;catch&lt;/span&gt; (DataServiceQueryException ex)
               {
                   MessageBox.Show(&lt;span style="COLOR: #006080"&gt;"Query "&lt;/span&gt; + ex.Message);
               }
           }), entities);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I hope that has given you an insight to using data with Silverlight 2 – I will be adding more posts to drill deeper into these topics, but you may want to look at the &lt;a target="_blank" href="http://msdn.microsoft.com/en-gb/library/cc903956(VS.95).aspx"&gt;Msdn docs&lt;/a&gt; for this for further info&lt;/p&gt;
&lt;p&gt;I have uploaded this sample project to my skydrive here: &lt;font face="Arial"&gt;&lt;a href="http://cid-fb8b852ef1ab0b35.skydrive.live.com/self.aspx/SampleCode/SilverlightSimpleEditData.zip"&gt;http://cid-fb8b852ef1ab0b35.skydrive.live.com/self.aspx/SampleCode/SilverlightSimpleEditData.zip&lt;/a&gt;  &lt;/font&gt;&lt;/p&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16883.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Serializing Objects to Isolated Storage in Silverlight 2</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/11/27/serializing-objects-to-isolated-storage-in-silverlight-2.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/11/27/serializing-objects-to-isolated-storage-in-silverlight-2.aspx</id>
        <published>2008-11-27T11:26:04Z</published>
        <updated>2008-11-27T12:16:31Z</updated>
        <content type="html">&lt;p&gt;&lt;em&gt;[Cross posted from: &lt;/em&gt;&lt;a href="http://blackburnian.spaces.live.com/blog/cns!FB8B852EF1AB0B35!1107.entry"&gt;&lt;em&gt;SilverlightForBusiness.net&lt;/em&gt;&lt;/a&gt;&lt;em&gt; ]&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Silverlight 2 does not have a BinaryFormatter like the full framework does so you have to take a different approach to serializing data to Isolated Storage.&lt;/p&gt;  &lt;p&gt;However there is a simple solution by using the DataContractSerializer.  You will need to add a reference to System.Runtime.Serialization.  This will serialize the object to an Xml format and is what Silverlight uses when you add a service reference.&lt;/p&gt;  &lt;p&gt;So if we have an object called Person, we can use the DataContract and DataMember attributes to mark it up as follows:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;[DataContract]
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Person
{
    [DataMember]
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; PersonId { get; set; }
    [DataMember]
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Name { get; set; }
    
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You can then use the DataContractSerializer as follows to save Person data to Iso storage:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Person p = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Person() { PersonId = 1, Name = &lt;span style="color: #006080"&gt;"Fred"&lt;/span&gt; };
&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForSite())
{
    IsolatedStorageFileStream stream = store.CreateFile(&lt;span style="color: #006080"&gt;"Person.dat"&lt;/span&gt;);
    DataContractSerializer serializer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DataContractSerializer(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Person));
    serializer.WriteObject(stream, p);
    stream.Close();
}
MessageBox.Show(&lt;span style="color: #006080"&gt;"Data Saved"&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;And the following to read it:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Person p;
&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForSite())
{
    IsolatedStorageFileStream stream = store.OpenFile(&lt;span style="color: #006080"&gt;"Person.dat"&lt;/span&gt;, FileMode.Open);
    DataContractSerializer serializer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DataContractSerializer(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Person));
    p = (Person)serializer.ReadObject(stream);
    stream.Close();
}
MessageBox.Show(&lt;span style="color: #006080"&gt;"Data Loaded"&lt;/span&gt;);
TextBlock1.Text = p.Name + &lt;span style="color: #006080"&gt;" "&lt;/span&gt; + p.PersonId;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If you want to make this more generic you could create a generic method as follows:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SaveData&amp;lt;T&amp;gt;(T dataToSave,&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fileName)
{
    &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForSite())
    {
        IsolatedStorageFileStream stream = store.CreateFile(fileName);
        DataContractSerializer serializer = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DataContractSerializer(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(T));
        serializer.WriteObject(stream, dataToSave);
        stream.Close();
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;Then you can call it as follows:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;SaveData&amp;lt;ObservableCollection&amp;lt;Person&amp;gt;&amp;gt;(people, &lt;span style="color: #006080"&gt;"People.dat"&lt;/span&gt;);
SaveData&amp;lt;Person&amp;gt;(person, &lt;span style="color: #006080"&gt;"Person.dat"&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:49c82897-a00b-4dd5-b9e5-aff07dab7ef4" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Serialization" rel="tag"&gt;Serialization&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Isolated+Storage" rel="tag"&gt;Isolated Storage&lt;/a&gt;&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;Cheers&lt;/p&gt;

&lt;p&gt;Ian&lt;/p&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16881.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Announcing: Silverlight &amp;quot;Power Seminar&amp;quot;</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/11/12/announcing-silverlight-quotpower-seminarquot.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/11/12/announcing-silverlight-quotpower-seminarquot.aspx</id>
        <published>2008-11-12T15:15:41Z</published>
        <updated>2008-11-12T15:15:41Z</updated>
        <content type="html">&lt;p&gt;&lt;b&gt;Kings Hill Conference &amp;amp; Training Centre (&lt;/b&gt;&lt;a href="http://khi.gre.ac.uk/ourLocation.html"&gt;location&lt;/a&gt;)&lt;b&gt;     &lt;br /&gt;Friday November 28th, 2008 (10am-1pm)&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;I am presenting this seminar in Kings Hill on November 28th – should be a good overview and I will be drilling into some depth with the demo’s later on. Hope you can make it.&lt;/p&gt;  &lt;p&gt;Marketing info and content below ;-)&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Don't miss this opportunity for your company to get a great insight into this exciting technology and how it can affect your business&lt;/p&gt;    &lt;h5&gt;Special Offer &lt;/h5&gt;    &lt;ul&gt;     &lt;li&gt;Silverlight Power Seminar &lt;strong&gt;only £98+vat&lt;/strong&gt;&lt;/li&gt;      &lt;li&gt;&lt;strong&gt;Muffins and Danish pastries&lt;/strong&gt; included!&lt;/li&gt;      &lt;li&gt;Book by Friday 14th November and &lt;strong&gt;bring a colleague for half price: £49+vat&lt;/strong&gt;&lt;/li&gt;      &lt;li&gt;&lt;strong&gt;Free CD packed&lt;/strong&gt; with resources for every delegate PACKED with resources for every delegate&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;9:30 Registration, Danish Pastries, Muffins, Coffee and Tea &lt;/p&gt;    &lt;p&gt;10:00 - 11:00  &lt;strong&gt;Executive Overview.&lt;/strong&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;What is Silverlight?&lt;/li&gt;      &lt;li&gt;Key drivers and barriers&lt;/li&gt;      &lt;li&gt;Market placement and competing technologies (e.g. Flash, Ajax)&lt;/li&gt;      &lt;li&gt;What it takes to build Silverlight applications&lt;/li&gt;      &lt;li&gt;How will it affect my business?&lt;/li&gt;      &lt;li&gt;Silverlight strategic futures (the Microsoft Client: Desktop, Web and Mobile), Alexandria.&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;11:00 - 11:10  Break (tea and coffee)&lt;/p&gt;    &lt;p&gt;11:10 - 12:00 &lt;strong&gt;Silverlight for Designers&lt;/strong&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;What can you do with Silverlight?&lt;/li&gt;      &lt;li&gt;What can't you do with Silverlight?&lt;/li&gt;      &lt;li&gt;What is Xaml? &lt;/li&gt;      &lt;li&gt;Silverlight design tools (Expression suite, export from other tools such as Illustrator)&lt;/li&gt;      &lt;li&gt;How you can work more closely with Developers&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;12:00 - 12:10  Break (tea and coffee)&lt;/p&gt;    &lt;p&gt;12:10 - 13:00 &lt;strong&gt; Silverlight for Developers&lt;/strong&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;Silverlight managed code development in Visual Studio &lt;/li&gt;      &lt;li&gt;Understanding how Silverlight fits into a n-tier development &lt;/li&gt;      &lt;li&gt;Working with Data &lt;/li&gt;      &lt;li&gt;Understanding the HtmlBridge &lt;/li&gt;      &lt;li&gt;Other Silverlight features (threading, isolated storage...)&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;&lt;a href="http://www.bbits.co.uk/services/training/Silverlight.aspx"&gt;Book Now!&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:db117fc7-c0d0-4f6c-88c3-d3c1b31dc60e" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;&lt;/div&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16880.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Silverlight 2 vs. Asp.Net Ajax</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/11/05/silverlight-2-vs.-asp.net-ajax.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/11/05/silverlight-2-vs.-asp.net-ajax.aspx</id>
        <published>2008-11-05T19:15:03Z</published>
        <updated>2008-11-05T19:15:03Z</updated>
        <content type="html">&lt;p&gt;Shameless plug for my new blog:  &lt;a href="http://silverlightforbusiness.net"&gt;silverlightforbusiness.net&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And the latest article:  &lt;a href="http://blackburnian.spaces.live.com/blog/cns!FB8B852EF1AB0B35!1086.entry"&gt;Silverlight 2 vs. Asp.Net Ajax&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Ian&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:535b9384-9f3f-4c8d-8ff2-fa6a1e34a17f" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/asp.Net+Ajax" rel="tag"&gt;asp.Net Ajax&lt;/a&gt;&lt;/div&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16879.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>VS2010 &amp;ndash; two screenshots to warm the hearts of TDD fans</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/11/04/vs2010-ndash-two-screenshots-to-warm-the-hearts-of-tdd.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/11/04/vs2010-ndash-two-screenshots-to-warm-the-hearts-of-tdd.aspx</id>
        <published>2008-11-04T15:31:45Z</published>
        <updated>2008-11-04T15:31:45Z</updated>
        <content type="html">&lt;p&gt;When you are doing TDD you want more more than the Generate Method Stub functionality in VS2008 – you want to be able to generate stubs for anything!&lt;/p&gt;  &lt;p&gt;Well VS 2010 comes to the rescue (as it should since it states they are targeting TDD as mainstream for this release)&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.bbits.co.uk/blog/images/www_bbits_co_uk/blog/WindowsLiveWriter/VS2010twoscreenshotstowarmtheheartsofTDD_D97D/image_9cc6ecf3-10da-4b09-99fa-c3bf691ff392.png" width="644" height="149" /&gt; &lt;/p&gt;  &lt;p&gt;And if you click Generate Other:&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline" title="image" border="0" alt="image" src="http://www.bbits.co.uk/blog/images/www_bbits_co_uk/blog/WindowsLiveWriter/VS2010twoscreenshotstowarmtheheartsofTDD_D97D/image_d522d7ed-27dc-4d12-9fa9-781724868da9.png" width="528" height="480" /&gt; &lt;/p&gt;  &lt;p&gt;Nice one!&lt;/p&gt;  &lt;p /&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:930d078b-c144-4190-9052-37f9fb30466a" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/VS2010" rel="tag"&gt;VS2010&lt;/a&gt;,&lt;a href="http://technorati.com/tags/TDD" rel="tag"&gt;TDD&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Ian&lt;/p&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16878.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>New SilverlightForBusiness.net Blog</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/11/03/new-silverlightforbusiness.net-blog.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/11/03/new-silverlightforbusiness.net-blog.aspx</id>
        <published>2008-11-03T14:20:08Z</published>
        <updated>2008-11-03T14:20:37Z</updated>
        <content type="html">&lt;p&gt;Most developers and managers are impressed with Silverlight when they first see it, and most are keen see what it can do.  Most see the immediate benefits for rich web based UI, and often there is a comparison drawn with Flash (“Is Silverlight a Flash Killer?”).  However the business case is not always clear to them.&lt;/p&gt;  &lt;p&gt;I believe Silverlight offers a tremendous platform for Business Applications&lt;/p&gt;  &lt;p&gt;It’s not just the richness of the UI and the wide reach and lower maintenance of the web deployment, but the fact that it is built in managed .net code, with a rich framework that makes many powerful capabilities much easier (threading, isolated storage, wcf services, data binding, linq to name a few)&lt;/p&gt;  &lt;p&gt;So I have started a new blog over on &lt;a href="http://silverlightforbusiness.net/"&gt;silverlightforbusiness.net&lt;/a&gt; - this blog will be an exploration of using Silverlight for Enterprise/Business applications.  &lt;/p&gt;  &lt;p&gt;Some of the topics I will be exploring (in no particular order)&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;User productivity  - can a well design UI improve productivity for the user? &lt;/li&gt;    &lt;li&gt;Silverlight competitors/alternatives  – Ajax, Flash Java FX etc.. &lt;/li&gt;    &lt;li&gt;n-tier architecture with Silverlight UI &lt;/li&gt;    &lt;li&gt;Working with data (moving, shaping, binding, validating, paging) &lt;/li&gt;    &lt;li&gt;Services &lt;/li&gt;    &lt;li&gt;Html Interaction &lt;/li&gt;    &lt;li&gt;Where to put your business logic &lt;/li&gt;    &lt;li&gt;Security &lt;/li&gt;    &lt;li&gt;Future directions &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;To kick things of, take a look at this video from Jamie Cool from the recent PDC – it introduces many of the topics above and also a sneak peak of the next version of Silverlight (code name Alexandria) which provides a richer Business Logic Framework:&lt;/p&gt; &lt;a href="http://channel9.msdn.com/pdc2008/PC11/"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.bbits.co.uk/blog/images/www_bbits_co_uk/blog/WindowsLiveWriter/35d931a561ea_87F7/image_3.png" width="644" height="465" /&gt;&lt;/a&gt;   &lt;p&gt;&lt;a title="http://channel9.msdn.com/pdc2008/PC11/" href="http://channel9.msdn.com/pdc2008/PC11/"&gt;http://channel9.msdn.com/pdc2008/PC11/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Ian&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4acacc32-1e1b-4fd6-9190-310fdf1afd5e" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Business" rel="tag"&gt;Business&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Alexandria" rel="tag"&gt;Alexandria&lt;/a&gt;,&lt;a href="http://technorati.com/tags/n-tier" rel="tag"&gt;n-tier&lt;/a&gt;&lt;/div&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16877.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Creating Reusable Animations in Silverlight 2</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/11/01/creating-reusable-animations-in-silverlight-2.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/11/01/creating-reusable-animations-in-silverlight-2.aspx</id>
        <published>2008-11-01T09:36:08Z</published>
        <updated>2008-11-01T09:44:13Z</updated>
        <content type="html">&lt;p&gt;I &lt;a href="http://silverlight.net/forums/p/44965/122389.aspx#122389"&gt;answered a post on the Silverlight forums recently&lt;/a&gt; about creating reusable animations for an Image, and thought that it was worth a blog entry to expand on it a little.&lt;/p&gt;  &lt;p&gt;I am looking here at two common approaches to creating reusable animations within a single project:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;     &lt;p&gt;Create the animation in xaml (using Blend) on one element and then change the target in code.  This is easier to do but means you can only play one animation at a time (because only one animation actually exists)&lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;p&gt;Create the animation purely in code.  This means you can create as many as you want and have them all playing at the same time, and writing the code gives you more control over changing the animation conditionally at run time.&lt;/p&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Of course you can also have a combination of the two (so you could create the animation in blend, then create a copy of it in code and manipulate it)&lt;/p&gt;  &lt;h1&gt;Using the Xaml Approach&lt;/h1&gt;  &lt;p&gt;Here's an example of the first approach.  This is the Xaml created by recording an animation in Blend against "Image1".   Notice that I have given the two DoubleAnimationUsingKeyFrames elements names (GrowImageScaleXAnimation and GrowImageScaleYAnimation) so that it is easy to change their properties in code later on:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Storyboard&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="GrowImage"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;AutoReverse&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="True"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; 
                &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="GrowImageScaleXAnimation"&lt;/span&gt; 
                &lt;span style="color: #ff0000"&gt;BeginTime&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="00:00:00"&lt;/span&gt; 
                &lt;span style="color: #ff0000"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;TargetName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Image1"&lt;/span&gt; 
                &lt;span style="color: #ff0000"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;TargetProperty&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;SplineDoubleKeyFrame&lt;/span&gt; 
                    &lt;span style="color: #ff0000"&gt;KeyTime&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="00:00:00.5000000"&lt;/span&gt; 
                    &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="1.1"&lt;/span&gt; 
                    &lt;span style="color: #ff0000"&gt;KeySpline&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="0.24,0.75,0.9,1"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; 
                &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="GrowImageScaleYAnimation"&lt;/span&gt; 
                &lt;span style="color: #ff0000"&gt;BeginTime&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="00:00:00"&lt;/span&gt; 
                &lt;span style="color: #ff0000"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;TargetName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Image1"&lt;/span&gt; 
                &lt;span style="color: #ff0000"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;TargetProperty&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;SplineDoubleKeyFrame&lt;/span&gt; 
                    &lt;span style="color: #ff0000"&gt;KeyTime&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="00:00:00.5000000"&lt;/span&gt; 
                    &lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="1.1"&lt;/span&gt; 
                    &lt;span style="color: #ff0000"&gt;KeySpline&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="0.24,0.75,0.9,1"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Storyboard&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;UserControl.Resources&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;So if you have two images like this:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Image&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Image1"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="100"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="100"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Source&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Images/beta.jpg"&lt;/span&gt; &lt;br /&gt;           &lt;span style="color: #ff0000"&gt;MouseLeftButtonUp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Image_MouseLeftButtonUp"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;RenderTransformOrigin&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="0.5,0.5"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Image.RenderTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;TransformGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ScaleTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;SkewTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;RotateTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;TranslateTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;TransformGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Image.RenderTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Image&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Image&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Image2"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="100"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="100"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Source&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Images/beta.jpg"&lt;/span&gt; &lt;br /&gt;           &lt;span style="color: #ff0000"&gt;MouseLeftButtonUp&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="Image_MouseLeftButtonUp"&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;RenderTransformOrigin&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="0.5,0.5"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Image.RenderTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;TransformGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ScaleTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;SkewTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;RotateTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
                    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;TranslateTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;TransformGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Image.RenderTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Image&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;You can write the following code to play the animation on either one:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; PlayXamlImageAnimation(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ImageName)
{
    GrowImage.Stop();
    Storyboard.SetTargetName(GrowImageScaleXAnimation, ImageName);
    Storyboard.SetTargetName(GrowImageScaleYAnimation, ImageName);
    GrowImage.Begin();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;h1&gt;Using the Pure Code Approach&lt;/h1&gt;

&lt;p&gt;For the pure code approach you create the animation in code and attach it to the image.  Here is my code to create the animation:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Storyboard CreateAnimation(DependencyObject image)
{
    Storyboard board = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Storyboard();
    board.AutoReverse = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;

    DoubleAnimationUsingKeyFrames scaleXAnim = &lt;br /&gt;           GetAnimation(image, &lt;span style="color: #006080"&gt;"(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"&lt;/span&gt;);
    DoubleAnimationUsingKeyFrames scaleYAnim = &lt;br /&gt;           GetAnimation(image, &lt;span style="color: #006080"&gt;"(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"&lt;/span&gt;);
    
    board.Children.Add(scaleXAnim);
    board.Children.Add(scaleYAnim);

    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; board;
}

&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; DoubleAnimationUsingKeyFrames GetAnimation(DependencyObject image,&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; propertyPath)
{
    DoubleAnimationUsingKeyFrames animation = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DoubleAnimationUsingKeyFrames();
    animation.BeginTime = TimeSpan.FromSeconds(0);
    Storyboard.SetTarget(animation, image);
    Storyboard.SetTargetProperty(animation, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PropertyPath(propertyPath, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt;[0]));


    SplineDoubleKeyFrame spline = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SplineDoubleKeyFrame();
    spline.KeyTime = TimeSpan.FromSeconds(0.5);
    spline.Value = 1.1;
    KeySpline keySpline = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; KeySpline();
    keySpline.ControlPoint1 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Point(0.24, 0.75);
    keySpline.ControlPoint2 = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Point(0.9, 1);
    spline.KeySpline = keySpline;
    animation.KeyFrames.Add(spline);
    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; animation;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;This produces exactly the same animation that was shown in the Xaml above, but is quite a bit more work (in truth I still find it easier to record this in Blend, then manually convert it to code from the Xaml)  The benefit is that we have more control and we can get as many animation instances we want so that we can have them all playing at the same time on different images.  So in this example I create two Storyboards and then instantiate them against my images in the constructor for the page:&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;Storyboard image1Animation;
Storyboard image2Animation;

&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Page()
{
    InitializeComponent();
    image1Animation = CreateAnimation(Image1);
    image2Animation =  CreateAnimation(Image2);

}&lt;/pre&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;Then it is simple a matter of playing the animations when needed.&lt;/p&gt;

&lt;p&gt;You can download the source from &lt;a href="http://cid-fb8b852ef1ab0b35.skydrive.live.com/self.aspx/SampleCode/SilverlightImageResize.zip"&gt;my sky drive&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;

&lt;p&gt;Ian&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:74cb6df4-d231-4cdb-bc91-8c14f4463893" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Xaml" rel="tag"&gt;Xaml&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Animations" rel="tag"&gt;Animations&lt;/a&gt;&lt;/div&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16875.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>VB.Net and C# to draw closer together for v4</title>
        <link rel="alternate" type="text/html" href="http://bbits.co.uk/blog/archive/2008/10/30/vb.net-and-c-to-draw-closer-together-for-v4.aspx" />
        <id>http://bbits.co.uk/blog/archive/2008/10/30/vb.net-and-c-to-draw-closer-together-for-v4.aspx</id>
        <published>2008-10-30T16:38:03Z</published>
        <updated>2008-10-30T16:38:03Z</updated>
        <content type="html">&lt;p&gt;There are some interesting improvements for C# 4 as detailed &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=csharpfuture&amp;amp;DownloadId=3550"&gt;here&lt;/a&gt;, but I was struck by the following comment in that document.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;A secondary theme is co-evolution with Visual Basic. Going forward we will aim to maintain the individual character of each language, but at the same time important new features should be introduced in both languages at the same time. They should be differentiated more by style and feel than by feature set.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I think this will be a surprise for many vb programmers who have seen a gradual move away from their language to c# for many demos and resources, and a growing frustration that they are being left behind.&lt;/p&gt;  &lt;p&gt;Of course the IDE needs to have the same theme of co-evolution for this to work well – refactoring for example is painfully missing in VB.Net for VS 2008.&lt;/p&gt;  &lt;p&gt;So this is good news for mixed language development teams and for general resource management within the industry but the proof will be in the pudding for VS 2010 – I look forward to seeing it.&lt;/p&gt;  &lt;p&gt;Cheers&lt;/p&gt;  &lt;p&gt;Ian&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:b963c202-eec4-426c-935c-faf8e7ec7996" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/C%23+4" rel="tag"&gt;C# 4&lt;/a&gt;,&lt;a href="http://technorati.com/tags/VB.Net" rel="tag"&gt;VB.Net&lt;/a&gt;&lt;/div&gt;&lt;img src="http://bbits.co.uk/blog/aggbug/16874.aspx" width="1" height="1" /&gt;</content>
    </entry>
</feed>