<rss version="2.0" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>bobby's blog</title>
        <link>http://blog.bmdiaz.com/Default.aspx</link>
        <description> randomly specific...</description>
        <language>en-US</language>
        <copyright>Bobby Diaz</copyright>
        <managingEditor>bmdiaz@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>bobby's blog</title>
            <url>http://blog.bmdiaz.com/images/RSS2Image.gif</url>
            <link>http://blog.bmdiaz.com/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Handy ASP.NET MVC 2 Extension Methods &amp;ndash; Where am I?</title>
            <category>ASP.NET</category>
            <category>MVC</category>
            <link>http://blog.bmdiaz.com/archive/2010/04/09/handy-asp.net-mvc-2-extension-methods-ndash-where-am-i.aspx</link>
            <description>&lt;p&gt;Have you ever needed to detect what part of the application is currently being viewed?  This might be a bigger issue if you write a lot of shared/partial views or custom display or editor templates.  Another scenario, which is the one I encountered when I first started down this path, is when you have some type of menu and you’d like to be able to determine which item represents the current page so you can highlight it in some way.  A simple example is the menu that is created as part of the default ASP.NET MVC 2 Application template.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;div &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;id&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;menucontainer&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;ul &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;id&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;menu&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;li&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;= &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Html.ActionLink&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;(&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Index&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;) %&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;li&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;= &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Html.ActionLink&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;(&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;About&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;About&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;) %&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The part that got me at first, however, was the following entry in the default style sheet (Site.css):&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #f8f8f8"&gt;ul#menu li.selected a&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #f8f8f8"&gt;&lt;font color="#ffff00"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #f8f8f8"&gt;    &lt;font color="#0000ff"&gt;background-color&lt;/font&gt;&lt;font color="#ffff00"&gt;:&lt;/font&gt; &lt;font color="#8080ff"&gt;#fff&lt;/font&gt;&lt;font color="#ffff00"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #f8f8f8"&gt;    &lt;font color="#0000ff"&gt;color&lt;/font&gt;&lt;font color="#ffff00"&gt;:&lt;/font&gt; &lt;font color="#8080ff"&gt;#000&lt;/font&gt;&lt;font color="#ffff00"&gt;;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #f8f8f8"&gt;&lt;font color="#ffff00"&gt;}&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt; &lt;font color="#e7e7e7"&gt;&lt;/font&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;I assumed that the &lt;strong&gt;&lt;em&gt;.selected&lt;/em&gt;&lt;/strong&gt; class would automatically get applied to the active menu item.  After trying a few different things, including the &lt;a href="http://mvccontrib.codeplex.com/" target="_blank"&gt;MvcContrib MenuBuilder&lt;/a&gt;, I decided to write my own extension methods so I would have more control over the output.  First, I needed a way to determine what view the user has navigated to based on the requested URL and route configuration.  Now, I am sure there are many ways to do this, but this is what I came up with:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;     &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;RequestExtensions&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;{&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;bool&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;IsCurrentRoute&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af"&gt;RequestContext&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;context&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;areaName&lt;/span&gt;, &lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;params&lt;/span&gt; &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;[] &lt;span style="color: #eee8aa"&gt;actionNames&lt;/span&gt;)&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;routeData&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;context&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;RouteData&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;routeArea&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;routeData&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataTokens&lt;/span&gt;[&lt;span style="color: #60ff60"&gt;"area"&lt;/span&gt;] &lt;span style="color: #40c4ff"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;current&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;false&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( ((&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsNullOrEmpty&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;routeArea&lt;/span&gt;) &lt;span style="color: silver"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsNullOrEmpty&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;areaName&lt;/span&gt;)) &lt;span style="color: silver"&gt;||&lt;/span&gt; &lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;              (&lt;span style="color: #eee8aa"&gt;routeArea&lt;/span&gt; &lt;span style="color: silver"&gt;==&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;areaName&lt;/span&gt;)) &lt;span style="color: silver"&gt;&amp;amp;&amp;amp;          &lt;br /&gt;          &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;             ((&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsNullOrEmpty&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;)) &lt;span style="color: silver"&gt;||&lt;/span&gt; &lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;              (&lt;span style="color: #eee8aa"&gt;routeData&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetRequiredString&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"controller"&lt;/span&gt;) &lt;span style="color: silver"&gt;==&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;)) &lt;span style="color: silver"&gt;&amp;amp;&amp;amp;          &lt;br /&gt;          &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: silver"&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;             ((&lt;span style="color: #eee8aa"&gt;actionNames&lt;/span&gt; &lt;span style="color: silver"&gt;==&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;) &lt;span style="color: silver"&gt;||&lt;/span&gt; &lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;               &lt;span style="color: #eee8aa"&gt;actionNames&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Contains&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;routeData&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetRequiredString&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"action"&lt;/span&gt;))) )&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #eee8aa"&gt;current&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;true&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;current&lt;/span&gt;;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #ff80c0"&gt;// additional overloads omitted...&lt;/span&gt;&lt;/p&gt;      &lt;p style="margin: 0px; line-height: 14px"&gt;}&lt;/p&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;With that in place, I was able to write several UrlHelper methods that check if the supplied values map to the current view.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;UrlExtensions&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;bool&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;IsCurrent&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af"&gt;UrlHelper&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;urlHelper&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;areaName&lt;/span&gt;, &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;params&lt;/span&gt; &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;[] &lt;span style="color: #eee8aa"&gt;actionNames&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;urlHelper&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;RequestContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsCurrentRoute&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;areaName&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;actionNames&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;string&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Selected&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af"&gt;UrlHelper&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;urlHelper&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;areaName&lt;/span&gt;, &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;params&lt;/span&gt; &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;[] &lt;span style="color: #eee8aa"&gt;actionNames&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;urlHelper&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsCurrent&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;areaName&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;actionNames&lt;/span&gt;) &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: silver"&gt;?&lt;/span&gt; &lt;span style="color: #60ff60"&gt;"selected"&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Empty&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #ff80c0"&gt;// additional overloads omitted...&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Now I can re-work the original menu to utilize these new methods.  Note: be sure to import the proper namespace so the extension methods become available inside your views!&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;div &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;id&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;menucontainer&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;ul &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;id&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;menu&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;li &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;class&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;= &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Url.Selected&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;(&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;null&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Index&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;)&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;"&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;= &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Html.ActionLink&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;(&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Index&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;)%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;li &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;class&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;= &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Url.Selected&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;(&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;null&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;About&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;)&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;"&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;= &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Html.ActionLink&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;(&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;About&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;About&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;)%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;If we take it one step further, we can clean up the markup even more.  Check out the Html.ActionMenuItem() extension method and the refined menu:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;HtmlExtensions&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;MvcHtmlString&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;ActionMenuItem&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af"&gt;HtmlHelper&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;htmlHelper&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;linkText&lt;/span&gt;, &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;actionName&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;html&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;StringBuilder&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"&amp;lt;li"&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: #eee8aa"&gt;htmlHelper&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ViewContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;RequestContext&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #eee8aa"&gt;                &lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsCurrentRoute&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;actionName&lt;/span&gt;) )&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #eee8aa"&gt;html&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Append&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;" class=\"selected\""&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;html&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Append&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"&amp;gt;"&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Append&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;htmlHelper&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ActionLink&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;linkText&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;actionName&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;))&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Append&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"&amp;lt;/li&amp;gt;"&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af"&gt;MvcHtmlString&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Create&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;html&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ToString&lt;/span&gt;());&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #ff80c0"&gt;// additional overloads omitted...&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; Thanks to Ryan for reminding me to use the TagBuilder class instead of the StringBuilder for generating the HTML for the menu item!  Here is the refactored method:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;HtmlExtensions&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;MvcHtmlString&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;ActionMenuItem&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt; &lt;span style="color: #2b91af"&gt;HtmlHelper&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;htmlHelper&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;linkText&lt;/span&gt;, &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;actionName&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;tag&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;TagBuilder&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"li"&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: #eee8aa"&gt;htmlHelper&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ViewContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;RequestContext&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #eee8aa"&gt;            &lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsCurrentRoute&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;actionName&lt;/span&gt;) )&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #eee8aa"&gt;tag&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;AddCssClass&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"selected"&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;tag&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;InnerHtml&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;htmlHelper&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ActionLink&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;linkText&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;actionName&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;controllerName&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ToString&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af"&gt;MvcHtmlString&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Create&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;tag&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ToString&lt;/span&gt;());&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;div &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;id&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;menucontainer&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;ul &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;id&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;menu&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;= &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Html.ActionMenuItem&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;(&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Index&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;)&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;= &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Html.ActionMenuItem&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;(&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;About&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;About&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;,&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Home&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;)&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;%&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Which generates the following HTML:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;div &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;id&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;menucontainer&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;ul &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;id&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;menu&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;li &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;class&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;selected&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&amp;lt;a &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;href&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;/&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;Home&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;li&amp;gt;&amp;lt;a &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;href&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;/Home/About&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #f8f8f8"&gt;About&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;I have created a &lt;a href="http://www.codepaste.net/fdeo3j" target="_blank"&gt;codepaste of these extension methods&lt;/a&gt; if you are interested in using them in your own projects.  Enjoy!&lt;/p&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/139165.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/04/09/handy-asp.net-mvc-2-extension-methods-ndash-where-am-i.aspx</guid>
            <pubDate>Fri, 09 Apr 2010 05:13:27 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/139165.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/04/09/handy-asp.net-mvc-2-extension-methods-ndash-where-am-i.aspx#feedback</comments>
            <slash:comments>16</slash:comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/139165.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/139165.aspx</trackback:ping>
        </item>
        <item>
            <title>Using RIA DomainServices with ASP.NET and MVC 2</title>
            <category>ASP.NET</category>
            <category>MVC</category>
            <category>RIA</category>
            <category>Silverlight</category>
            <category>WCF</category>
            <link>http://blog.bmdiaz.com/archive/2010/04/03/using-ria-domainservices-with-asp.net-and-mvc-2.aspx</link>
            <description>&lt;p&gt;Recently, I started working on a new ASP.NET MVC 2 project and I wanted to reuse the data access (LINQ to SQL) and business logic methods (WCF RIA Services) that had been developed for a previous project that used Silverlight for the front-end.  I figured that I would be able to instantiate the various DomainService classes from within my controller’s action methods, because after all, the code for those services didn’t look very complicated.  WRONG!  I didn’t realize at first that some of the functionality is handled automatically by the framework when the domain services are hosted as WCF services.  After some initial searching, I came across an invaluable post by &lt;a href="http://xamlcoder.com/blog/?p=7" target="_blank"&gt;Joe McBride&lt;/a&gt;, which described how to get RIA Service .svc files to work in an MVC 2 Web Application, and another by &lt;a href="http://blogs.msdn.com/brada/archive/2009/07/30/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-part-xx-asp-net-mvc.aspx" target="_blank"&gt;Brad Abrams&lt;/a&gt;.  Unfortunately, Brad’s solution was for an earlier preview release of RIA Services and no longer works with the version that I am running (PDC Preview).    &lt;br /&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;I have not tried the RC version of WCF RIA Services, so I am not sure if any of the issues I am having have been resolved, but I wanted to come up with a way to reuse the shared libraries so I wouldn’t have to write a non-RIA version that basically did the same thing.  The classes I came up with work with the scenarios I have encountered so far, but I wanted to go ahead and post the code in case someone else is having the same trouble I had.  Hopefully this will save you a few headaches!   &lt;br /&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1. Querying&lt;/strong&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;When I first tried to use a DomainService class to perform a query inside one of my controller’s action methods, I got an error stating that “This DomainService has not been initialized.”  To solve this issue, I created an extension method for all DomainServices that creates the required DomainServiceContext and passes it to the service’s Initialize() method.  Here is the code for the extension method; notice that I am creating a sort of mock HttpContext for those cases when the service is running outside of IIS, such as during unit testing!    &lt;br /&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ServiceExtensions&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Initializes the domain service by creating a new &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="DomainServiceContext"/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; and calling the base DomainService.Initialize(DomainServiceContext) method.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TService"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the service.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="service"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The service.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TService&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Initialize&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TService&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TService&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;service&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TService&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;DomainService&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;context&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;CreateDomainServiceContext&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #eee8aa"&gt;service&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Initialize&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;context&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;service&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;private&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;DomainServiceContext&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;CreateDomainServiceContext&lt;/span&gt;()&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;provider&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ServiceProvider&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;HttpContextWrapper&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;GetHttpContext&lt;/span&gt;()));&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;DomainServiceContext&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;provider&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;DomainOperationType&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Query&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;private&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;GetHttpContext&lt;/span&gt;()&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;context&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Current&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #8080ff"&gt;#if&lt;/span&gt; DEBUG&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #ff80c0"&gt;// create a mock HttpContext to use during unit testing...&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: #eee8aa"&gt;context&lt;/span&gt; &lt;span style="color: silver"&gt;==&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt; )&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;writer&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;StringWriter&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;request&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SimpleWorkerRequest&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"/"&lt;/span&gt;, &lt;span style="color: #60ff60"&gt;"/"&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Empty&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Empty&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;writer&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #eee8aa"&gt;context&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;request&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #eee8aa"&gt;User&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;GenericPrincipal&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;GenericIdentity&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"debug"&lt;/span&gt;), &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                };&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #8080ff"&gt;#endif&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;context&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;With that in place, I can use it almost as normally as my first attempt, except with a call to Initialize():    &lt;br /&gt;&lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ActionResult&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Index&lt;/span&gt;()&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;service&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;NorthwindService&lt;/span&gt;()&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Initialize&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;customers&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;service&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetCustomers&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;View&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;customers&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;2. Insert / Update / Delete&lt;/strong&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Once I got the records showing up, I was trying to insert new records or update existing data when I ran into the next issue.  I say issue because I wasn’t getting any kind of error, which made it a little difficult to track down.  But once I realized that that the DataContext.SubmitChanges() method gets called automatically at the end of each domain service submit operation, I could start working on a way to mimic the behavior of a hosted domain service.  What I came up with, was a base class called LinqToSqlRepository&amp;lt;T&amp;gt; that basically sits between your implementation and the default LinqToSqlDomainService&amp;lt;T&amp;gt; class.    &lt;br /&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;    [&lt;span style="color: #2b91af"&gt;EnableClientAccess&lt;/span&gt;()]&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;NorthwindService&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;LinqToSqlRepository&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;NorthwindDataContext&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;IQueryable&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Customer&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;GetCustomers&lt;/span&gt;()&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Customers&lt;/span&gt;;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;void&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;InsertCustomer&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Customer&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;customer&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Customers&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;InsertOnSubmit&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;customer&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;void&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;UpdateCustomer&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Customer&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;currentCustomer&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Customers&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TryAttach&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;currentCustomer&lt;/span&gt;,&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ChangeSet&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetOriginal&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;currentCustomer&lt;/span&gt;));&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;void&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;DeleteCustomer&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Customer&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;customer&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Customers&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TryAttach&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;customer&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Customers&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DeleteOnSubmit&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;customer&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;   &lt;br /&gt;Notice the new base class name (just change LinqToSqlDomainService to LinqToSqlRepository).  I also added a couple of DataContext (for Table&amp;lt;T&amp;gt;) extension methods called TryAttach that will check to see if the supplied entity is already attached before attempting to attach it, which would cause an error!    &lt;br /&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;3. LinqToSqlRepository&amp;lt;T&amp;gt;&lt;/strong&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Below is the code for the LinqToSqlRepository class.  The comments are pretty self explanatory, but be aware of the [IgnoreOperation] attributes on the generic repository methods, which ensures that they will be ignored by the code generator and not available in the Silverlight client application.    &lt;br /&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: consolas"&gt;   &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Provides generic repository methods on top of the standard&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="LinqToSqlDomainService&amp;amp;lt;TContext&amp;amp;gt;"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; functionality.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TContext"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the context.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;abstract&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;LinqToSqlRepository&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TContext&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;LinqToSqlDomainService&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TContext&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TContext&lt;/span&gt; : &lt;span style="color: #eee8aa"&gt;System&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Data&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Linq&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #2b91af"&gt;DataContext&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt;()&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Retrieves an instance of an entity using it's unique identifier.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TEntity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="keyValues"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The key values.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        [&lt;span style="color: #2b91af"&gt;IgnoreOperation&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;GetById&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;params&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;object&lt;/span&gt;[] &lt;span style="color: #eee8aa"&gt;keyValues&lt;/span&gt;) &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; : &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;table&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetTable&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mapping&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Mapping&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetTable&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;typeof&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;));&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;keys&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mapping&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;RowType&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IdentityMembers&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Select&lt;/span&gt;((&lt;span style="color: #eee8aa"&gt;m&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;i&lt;/span&gt;) &lt;span style="color: silver"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;m&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Name&lt;/span&gt; &lt;span style="color: silver"&gt;+&lt;/span&gt; &lt;span style="color: #60ff60"&gt;" = @"&lt;/span&gt; &lt;span style="color: silver"&gt;+&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;i&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ToArray&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;table&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Where&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Join&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;" &amp;amp;&amp;amp; "&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;keys&lt;/span&gt;), &lt;span style="color: #eee8aa"&gt;keyValues&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FirstOrDefault&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Creates a new query that can be executed to retrieve a collection&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; of entities from the &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="DataContext"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TEntity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        [&lt;span style="color: #2b91af"&gt;IgnoreOperation&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #2b91af"&gt;IQueryable&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;GetEntityQuery&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;() &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; : &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetTable&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Inserts the specified entity.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TEntity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="entity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        [&lt;span style="color: #2b91af"&gt;IgnoreOperation&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;bool&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Insert&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;) &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; : &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #ff80c0"&gt;//var table = this.DataContext.GetTable&amp;lt;TEntity&amp;gt;();&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #ff80c0"&gt;//table.InsertOnSubmit(entity);&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Submit&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;DomainOperation&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Insert&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Updates the specified entity.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TEntity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="entity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        [&lt;span style="color: #2b91af"&gt;IgnoreOperation&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;bool&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Update&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;) &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; : &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Update&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Updates the specified entity.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TEntity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="entity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="original"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The original.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        [&lt;span style="color: #2b91af"&gt;IgnoreOperation&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;bool&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Update&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;original&lt;/span&gt;) &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; : &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: #eee8aa"&gt;original&lt;/span&gt; &lt;span style="color: silver"&gt;==&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt; )&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #eee8aa"&gt;original&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;GetOriginal&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;table&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;DataContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetTable&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #eee8aa"&gt;table&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TryAttach&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;original&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Submit&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;original&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;DomainOperation&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Update&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Deletes the specified entity.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TEntity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="entity"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The entity.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        [&lt;span style="color: #2b91af"&gt;IgnoreOperation&lt;/span&gt;]&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;bool&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Delete&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;) &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; : &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #ff80c0"&gt;//var table = this.DataContext.GetTable&amp;lt;TEntity&amp;gt;();&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #ff80c0"&gt;//table.TryAttach(entity);&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #ff80c0"&gt;//table.DeleteOnSubmit(entity);&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Submit&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;DomainOperation&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Delete&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;protected&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;virtual&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;bool&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Submit&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Object&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;Object&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;original&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;DomainOperation&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;operation&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;entry&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ChangeSetEntry&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;0&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;original&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;operation&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;changes&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ChangeSet&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ChangeSetEntry&lt;/span&gt;[] { &lt;span style="color: #eee8aa"&gt;entry&lt;/span&gt; });&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;base&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Submit&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;changes&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;private&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;GetOriginal&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;) &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt; : &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;context&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;CreateDataContext&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;table&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;context&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetTable&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEntity&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;table&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FirstOrDefault&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;e&lt;/span&gt; &lt;span style="color: silver"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;e&lt;/span&gt; &lt;span style="color: silver"&gt;==&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;entity&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;    &lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;4. Conclusion&lt;/strong&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;So there you have it, a fully functional Repository implementation for your RIA Domain Services that can be consumed by your ASP.NET and MVC applications.  I have &lt;a href="http://www.bmdiaz.com/Files/MvcRiaApplication.zip" target="_blank"&gt;uploaded the source code&lt;/a&gt; along with unit tests and a sample web application that queries the Customers table from inside a Controller, as well as a Silverlight usage example.    &lt;br /&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;As always, I welcome any comments or suggestions on the approach I have taken.  If there is enough interest, I plan on contacting &lt;a href="http://twitter.com/SLColinBlair" target="_blank"&gt;Colin Blair&lt;/a&gt; or maybe even the man himself, &lt;a href="http://twitter.com/brada" target="_blank"&gt;Brad Abrams&lt;/a&gt;, to see if this is something worthy of inclusion in the &lt;a href="http://riaservicescontrib.codeplex.com/" target="_blank"&gt;WCF RIA Services Contrib&lt;/a&gt; project.  What do you think?    &lt;br /&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/139066.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/04/03/using-ria-domainservices-with-asp.net-and-mvc-2.aspx</guid>
            <pubDate>Sat, 03 Apr 2010 09:31:13 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/139066.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/04/03/using-ria-domainservices-with-asp.net-and-mvc-2.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/139066.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/139066.aspx</trackback:ping>
        </item>
        <item>
            <title>KISS and Tell - MVVM and the ViewModelLocator</title>
            <category>Silverlight</category>
            <category>MVVM</category>
            <link>http://blog.bmdiaz.com/archive/2010/03/31/kiss-and-tell---mvvm-and-the-viewmodellocator.aspx</link>
            <description>&lt;p&gt;A popular topic that comes up when talking about MVVM is the use of a ViewModelLocator and the many different ways one can be implemented.  Rather than getting into the pros and cons on when or why you should use it, I decided I would just post my version of a simple ViewModelLocator and let those who like it use it, and those who don’t, well you know…  :)   &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;First, a disclaimer.  I have not used this code in a production application, it is just something I was tossing around while reading others’ posts on the subject.   &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;1. MainView.xaml&lt;/p&gt; &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/WindowsLiveWriter/KISSandTellMVVMandtheViewModelLocator_974B/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="292" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/WindowsLiveWriter/KISSandTellMVVMandtheViewModelLocator_974B/image_thumb.png" width="604" border="0" /&gt;&lt;/a&gt;   &lt;p&gt; &lt;/p&gt;  &lt;p&gt;2. MainViewModel.cs   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/WindowsLiveWriter/KISSandTellMVVMandtheViewModelLocator_974B/image_4.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="444" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/WindowsLiveWriter/KISSandTellMVVMandtheViewModelLocator_974B/image_thumb_1.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p style="clear:both;"&gt;   &lt;br /&gt;3. ViewModelLocator.cs&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/WindowsLiveWriter/KISSandTellMVVMandtheViewModelLocator_974B/image_6.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="866" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/WindowsLiveWriter/KISSandTellMVVMandtheViewModelLocator_974B/image_thumb_2.png" width="604" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;I have a &lt;a href="http://codepaste.net/dkhkov" target="_blank"&gt;codepaste of the ViewModelLocator.cs&lt;/a&gt; file if you are interested but don’t feel like re-typing the 50 lines of code!    &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Enjoy!   &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Additional Resources&lt;/strong&gt;&lt;/p&gt;   &lt;ul&gt;   &lt;li&gt;&lt;a href="http://johnpapa.net/silverlight/simple-viewmodel-locator-for-mvvm-the-patients-have-left-the-asylum/" target="_blank"&gt;Simple ViewModel Locator for MVVM: The Patients Have Left the Asylum - by John Papa&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://csharperimage.jeremylikness.com/2010/03/viewmodel-binding-with-managed.html" target="_blank"&gt;ViewModel binding with the Managed Extensibility Framework - by Jeremy Likness&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://galasoft.ch/mvvm/getstarted/" target="_blank"&gt;MVVM Light Toolkit - by Laurent Bugnion&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/139021.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/03/31/kiss-and-tell---mvvm-and-the-viewmodellocator.aspx</guid>
            <pubDate>Wed, 31 Mar 2010 15:45:34 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/139021.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/03/31/kiss-and-tell---mvvm-and-the-viewmodellocator.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/139021.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/139021.aspx</trackback:ping>
        </item>
        <item>
            <title>The Open Data Protocol</title>
            <category>.NET</category>
            <category>OData</category>
            <link>http://blog.bmdiaz.com/archive/2010/03/16/the-open-data-protocol.aspx</link>
            <description>&lt;p&gt;Well, day 2 of the MIX10 conference did not disappoint.  The keynote speakers introduced the preview release of IE9, which looks really cool and quick, and Visual Studio 2010 RC that is scheduled to RTM on April 12th.  It seemed to have a lot of improvements aimed at making developers more productive.  Here are the current links to these two offerings:    &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font color="#e7e7e7"&gt;&lt;a href="http://ie.microsoft.com/testdrive/" target="_blank"&gt;Internet Explorer 9 – Platform Preview&lt;/a&gt;&lt;/font&gt; &lt;/li&gt;    &lt;li&gt;&lt;font color="#e7e7e7"&gt;&lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" target="_blank"&gt;Visual Studio 2010 and .NET 4 – Release Candidate&lt;/a&gt;&lt;/font&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br /&gt;While both of these were interesting, the demos that really blew me away today centered around the work being done with The Open Data Protocol, or OData for short!  OData is a recommended standard being pushed by Microsoft that uses a REST based interface to interact with various types of data in a uniform manner.  Data producers then provide the data to consumer in either ATOM or JSON formats as requested by the client application.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;The OData SDK contains client and server libraries for many of the popular languages in use today, including .NET, Java, PHP, Objective C and JavaScript, so you consume or even produce your own OData services.  More information can be found using the following links:     &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font color="#e7e7e7"&gt;&lt;a href="http://www.odata.org/" target="_blank"&gt;OData.org&lt;/a&gt;&lt;/font&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/alexj/archive/2009/11/18/tip-44-how-to-navigate-an-odata-compliant-service.aspx" target="_blank"&gt;How to navigate an OData compliant service&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc668793(VS.100).aspx" target="_blank"&gt;Query Functions (WCF Data Services)&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br /&gt;Netflix has made available one of the first live OData services by exposing their entire movie catalog.  You can browse and query using URLs similar to the following:     &lt;br /&gt;    &lt;br /&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a title="http://odata.netflix.com/" href="http://odata.netflix.com/"&gt;http://odata.netflix.com/&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://odata.netflix.com/Catalog/Genres('Horror')/CatalogTitles" href="http://odata.netflix.com/Catalog/Genres('Horror')/CatalogTitles"&gt;http://odata.netflix.com/Catalog/Genres('Horror')/CatalogTitles&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a title="http://odata.netflix.com/Catalog/CatalogTitles?$filter=startswith(Title/Regular,%20'Star%20Wars')&amp;amp;$orderby=Title/Regular" href="http://odata.netflix.com/Catalog/CatalogTitles?$filter=startswith(Title/Regular,%20'Star%20Wars')&amp;amp;$orderby=Title/Regular"&gt;http://odata.netflix.com/Catalog/CatalogTitles?$filter=startswith(Title/Regular,%20'Star%20Wars')&amp;amp;$orderby=Title/Regular&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br /&gt;So now I just need to find an &lt;strike&gt;excuse&lt;/strike&gt; reason to start using OData in a real project!&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Enjoy!&lt;/p&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/138568.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/03/16/the-open-data-protocol.aspx</guid>
            <pubDate>Wed, 17 Mar 2010 02:55:13 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/138568.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/03/16/the-open-data-protocol.aspx#feedback</comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/138568.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/138568.aspx</trackback:ping>
        </item>
        <item>
            <title>Silverlight 4 and Windows Phone Development</title>
            <category>Silverlight</category>
            <category>Windows Phone</category>
            <category>RIA</category>
            <link>http://blog.bmdiaz.com/archive/2010/03/15/silverlight-4-and-windows-phone-development.aspx</link>
            <description>&lt;p&gt;There were a lot of announcements made during the keynote at &lt;a href="http://live.visitmix.com/" target="_blank"&gt;MIX10&lt;/a&gt; today, most notable were the releases of Silverlight 4 RC, Silverlight 4 Tools for Visual Studio 2010, Expression Blend 4 Beta and the Windows Phone 7 Developer Tools.  I was glad to see that developers will be able to use Silverlight to create awesome applications for Windows Phone 7 so we can reuse our WPF and Silverlight skills to target mobile devices!    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;With so much information coming out of this conference, I wanted to be sure to save a list of links that I can quickly reference as I learn about these exciting new technologies:   &lt;br /&gt;&lt;/p&gt;  &lt;h4&gt;Silverlight 4&lt;/h4&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://timheuer.com/blog/archive/2010/03/15/whats-new-in-silverlight-4-rc-mix10.aspx" target="_blank"&gt;A guide to what has changed in the Silverlight 4 RC&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx" target="_blank"&gt;Silverlight 4 Beta – A guide to the new features&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://silverlight.net/getstarted/riaservices/" target="_blank"&gt;WCF RIA Services&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://silverlight.net/getstarted/silverlight-4/" target="_blank"&gt;Silverlight 4 Information&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://silverlight.codeplex.com/" target="_blank"&gt;Silverlight Toolkit&lt;/a&gt;  &lt;strike&gt;March 2010 Release&lt;/strike&gt;  was still showing Nov09 at time of posting…&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font color="#ffffff"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;h4&gt;Windows Phone 7&lt;/h4&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://timheuer.com/blog/archive/2010/03/15/get-started-with-silverlight-for-windows-phone.aspx" target="_blank"&gt;Getting Started with Silverlight and Windows Phone 7 Development&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://10rem.net/blog/2010/03/15/building-your-first-silverlight-for-windows-phone-application" target="_blank"&gt;Building your first Silverlight for Windows Phone Application&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://silverlight.net/getstarted/devices/windows-phone/" target="_blank"&gt;Silverlight for Windows Phone&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://developer.windowsphone.com/" target="_blank"&gt;Windows Phone for Developers&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.artificialignorance.net/blog/windows-phone-7/developing-for-windows-phone-7-series/" target="_blank"&gt;Developing for Windows Phone 7 Series&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font color="#ffffff"&gt;&lt;/font&gt;&lt;/p&gt; &lt;font color="#ffffff"&gt;   &lt;p&gt;     &lt;br /&gt;Whew, and that’s just from day 1!  Can’t wait to see what else comes out tomorrow.  Hopefully these links will give you a good starting point for Silverlight 4 and Windows Phone 7 information.&lt;/p&gt;    &lt;p&gt;&lt;font color="#ffffff"&gt;       &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;   &lt;font color="#ffffff"&gt;Enjoy!&lt;/font&gt;&lt;/font&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/138546.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/03/15/silverlight-4-and-windows-phone-development.aspx</guid>
            <pubDate>Tue, 16 Mar 2010 03:46:07 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/138546.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/03/15/silverlight-4-and-windows-phone-development.aspx#feedback</comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/138546.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/138546.aspx</trackback:ping>
        </item>
        <item>
            <title>Updated the Whiteboard Demo</title>
            <category>Silverlight</category>
            <category>Reactive</category>
            <link>http://blog.bmdiaz.com/archive/2010/03/14/updated-the-whiteboard-demo.aspx</link>
            <description>&lt;p&gt;Just a quick update to let everyone know that I have updated the Whiteboard demo application.  I added a few options to make it more interesting to use!  I showed it to the kids and they loved it (even though they kept asking ME to draw pictures for them)!&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;Here is a list of available options:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Color Picker for line color&lt;/li&gt;
    &lt;li&gt;Slider for line thickness&lt;/li&gt;
    &lt;li&gt;Save to valid XAML file&lt;/li&gt;
    &lt;li&gt;Open saved drawing&lt;/li&gt;
    &lt;li&gt;Clear whiteboard&lt;/li&gt;
    &lt;li&gt;Hold down ESC key to erase&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;
And here is a screenshot of my beautiful artwork! :)&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/11301/o_Grapes.png" /&gt;&lt;/p&gt;
&lt;p style="clear: both"&gt;&lt;br /&gt;
So what are you waiting for?  Go play with the &lt;a href="http://www.bmdiaz.com/Whiteboard"&gt;Live Demo&lt;/a&gt; (and be sure to share with the kids) or &lt;a href="http://www.bmdiaz.com/Files/Whiteboard.zip"&gt;download the source code&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Enjoy!&lt;/p&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/138507.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/03/14/updated-the-whiteboard-demo.aspx</guid>
            <pubDate>Sun, 14 Mar 2010 06:38:57 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/138507.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/03/14/updated-the-whiteboard-demo.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/138507.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/138507.aspx</trackback:ping>
        </item>
        <item>
            <title>Using the Reactive Extensions with the Silverlight Toolkit and MEF</title>
            <category>Silverlight</category>
            <category>Reactive</category>
            <category>MEF</category>
            <link>http://blog.bmdiaz.com/archive/2010/03/13/using-the-reactive-extensions-with-the-silverlight-toolkit-and-mef.aspx</link>
            <description>&lt;p&gt;I have come across several instances of people having trouble using the new Reactive Extensions (v1.0.2.5) in projects that reference the Silverlight Toolkit (Nov09) due to the fact that the original release of the Rx Framework (v1.0.0.0) was bundled with the Toolkit.  The trouble really becomes evident if you are using the Managed Extensibility Framework (MEF) to discover and compose portions of your application.&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;&lt;span style="color: #ff0000"&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/span&gt;  After getting some feedback in the comments, I was able to find a solution for the type load exception that works along with the DragDrop class of the Silverlight Toolkit!  The key is to load both versions of the System.Reactive.dll into the application.  You can't do it via the standard Add Reference, but the following code illustrates how it can be done:&lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;MainPage&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #ff80c0"&gt;// force previous version to be loaded&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;part&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;AssemblyPart&lt;/span&gt;() { &lt;span style="color: #eee8aa"&gt;Source&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #60ff60"&gt;"References/System.Reactive.v1.0.0.0.dll"&lt;/span&gt; };&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #2b91af"&gt;Deployment&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Current&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Parts&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Add&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;part&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;LoadReferences&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;InitializeComponent&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #ff80c0"&gt;// this works now!&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #2b91af"&gt;CompositionInitializer&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;SatisfyImports&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;References&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ItemsSource&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;references&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;
&lt;p&gt;The updated source code includes the previous dll in the Silverlight project as Content.  &lt;span style="color: #ff0000"&gt;&lt;strong&gt;End Update.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
If you are using the CompositionInitializer, or any other mechanism that probes all of the loaded assemblies for valid exports, you will likely receive the following error:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/11301/r_RxToolkitError.png" /&gt;&lt;/p&gt;
&lt;p style="clear: both"&gt;&lt;br /&gt;
Inspecting the LoaderExceptions property yields the following:&lt;br /&gt;
 &lt;/p&gt;
&lt;div style="margin-left: 40px"&gt;System.IO.FileNotFoundException: Could not load file or assembly 'System.Reactive, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1b331ac6720247d9' or one of its dependencies. The system cannot find the file specified.  File name: 'System.Reactive, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1b331ac6720247d9'&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
This is due to some of the Toolkit assemblies referencing the older System.Reactive.dll.  I was able to work around the issue by bypassing the automatic probing of loaded assemblies and instead specified which assemblies my exports could be found.&lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;MainPage&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;InitializeComponent&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #ff80c0"&gt;// the following line causes a ReflectionTypeLoadException&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #ff80c0"&gt;//CompositionInitializer.SatisfyImports(this);&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #ff80c0"&gt;// skip the toolkit assemblies by specifying assemblies&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;catalog&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;AssemblyCatalog&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;GetType&lt;/span&gt;()&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Assembly&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;container&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CompositionContainer&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;catalog&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;container&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ComposeParts&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;ShowReferences&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;
&lt;p&gt;&lt;br /&gt;
With some simple xaml, I was able to print out exactly which libraries are currently loaded in the application.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/11301/r_RxToolkitSuccess.png" /&gt;&lt;/p&gt;
&lt;p style="clear: both"&gt;&lt;br /&gt;
You can &lt;a href="http://www.bmdiaz.com/Files/RxToolkitTest.zip"&gt;download the sample project&lt;/a&gt; to run it for yourself!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Hope that helps!&lt;/p&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/138506.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/03/13/using-the-reactive-extensions-with-the-silverlight-toolkit-and-mef.aspx</guid>
            <pubDate>Sun, 14 Mar 2010 05:12:32 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/138506.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/03/13/using-the-reactive-extensions-with-the-silverlight-toolkit-and-mef.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/138506.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/138506.aspx</trackback:ping>
        </item>
        <item>
            <title>Generate Strongly Typed Observable Events for the Reactive Extensions for .NET (Rx)</title>
            <category>Silverlight</category>
            <category>LINQ</category>
            <category>Reactive</category>
            <link>http://blog.bmdiaz.com/archive/2010/03/11/generate-strongly-typed-observable-events-for-the-reactive-extensions-for.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;Update (14-Mar-2010):&lt;/strong&gt; &lt;a href="http://blog.bmdiaz.com/archive/2010/03/14/updated-the-whiteboard-demo.aspx"&gt;Updated the Whiteboard Demo&lt;/a&gt;&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;I must have tried reading through the various explanations and introductions to the new Reactive Extensions for .NET before the concepts finally started sinking in.  The article that gave me the ah-ha moment was over on &lt;a href="http://www.silverlightshow.net/"&gt;SilverlightShow.net&lt;/a&gt; and titled &lt;a href="http://www.silverlightshow.net/items/Using-Reactive-Extensions-in-Silverlight.aspx"&gt;Using Reactive Extensions in Silverlight&lt;/a&gt;.  The author did a good job comparing the "normal" way of handling events vs. the new "reactive" methods.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Admittedly, I still have more to learn about the Rx Framework, but I wanted to put together a sample project so I could start playing with the new Observable and IObservable&amp;lt;T&amp;gt; constructs.  I decided to throw together a whiteboard application in Silverlight based on the &lt;em&gt;&lt;strong&gt;Drawing with Rx&lt;/strong&gt;&lt;/em&gt; example on the aforementioned article.  At the very least, I figured I would learn a thing or two about a new technology, but my real goal is to create a fun application that I can share with the kids since they love drawing and coloring so much!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Here is the code sample that I borrowed from the article:&lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseMoveEvent&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Observable&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FromEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;MouseEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;, &lt;span style="color: #60ff60"&gt;"MouseMove"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseLeftButtonDown&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Observable&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FromEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;MouseButtonEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;, &lt;span style="color: #60ff60"&gt;"MouseLeftButtonDown"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseLeftButtonUp&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Observable&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FromEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;MouseButtonEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;, &lt;span style="color: #60ff60"&gt;"MouseLeftButtonUp"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;draggingEvents&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;from&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;pos&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;in&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseMoveEvent&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                             &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;SkipUntil&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;mouseLeftButtonDown&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                             &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TakeUntil&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;mouseLeftButtonUp&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                             &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Let&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;mm&lt;/span&gt; &lt;span style="color: silver"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mm&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Zip&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;mm&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Skip&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;1&lt;/span&gt;), (&lt;span style="color: #eee8aa"&gt;prev&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;cur&lt;/span&gt;) &lt;span style="color: silver"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                 &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                 {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                     &lt;span style="color: #eee8aa"&gt;X2&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;cur&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;EventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetPosition&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;X&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                     &lt;span style="color: #eee8aa"&gt;X1&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;prev&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;EventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetPosition&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;X&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                     &lt;span style="color: #eee8aa"&gt;Y2&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;cur&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;EventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetPosition&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Y&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                     &lt;span style="color: #eee8aa"&gt;Y1&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;prev&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;EventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetPosition&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Y&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                 }))&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Repeat&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                         &lt;span style="color: #40c4ff"&gt;select&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;pos&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #eee8aa"&gt;draggingEvents&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Subscribe&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;p&lt;/span&gt; &lt;span style="color: silver"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #2b91af"&gt;Line&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;line&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Line&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;line&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Stroke&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SolidColorBrush&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Colors&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Black&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;line&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;StrokeEndLineCap&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;PenLineCap&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Round&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;line&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;StrokeLineJoin&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;PenLineJoin&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Round&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;line&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;StrokeThickness&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #60ff60"&gt;5&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;line&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;X1&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;p&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;X1&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;line&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Y1&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;p&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Y1&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;line&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;X2&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;p&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;X2&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #eee8aa"&gt;line&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Y2&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;p&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Y2&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;LayoutRoot&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Children&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Add&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;line&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    });&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;&lt;!--EndFragment--&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
One thing that was nagging at the back of my mind was having to deal with the event names as strings, as well as the verbose syntax for the Observable.FromEvent&amp;lt;TEventArgs&amp;gt;() method.  I came up with a couple of static/helper classes to resolve both issues and also created a T4 template to auto-generate these helpers for any .NET type.  Take the following code from the above example:&lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseMoveEvent&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Observable&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FromEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;MouseEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;, &lt;span style="color: #60ff60"&gt;"MouseMove"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseLeftButtonDown&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Observable&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FromEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;MouseButtonEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;, &lt;span style="color: #60ff60"&gt;"MouseLeftButtonDown"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseLeftButtonUp&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Observable&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FromEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;MouseButtonEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;, &lt;span style="color: #60ff60"&gt;"MouseLeftButtonUp"&lt;/span&gt;);&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;
&lt;p&gt;&lt;br /&gt;
Turns into this with the new static Events class:&lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseMoveEvent&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Events&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Mouse&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Move&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;On&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseLeftButtonDown&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Events&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Mouse&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;LeftButtonDown&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;On&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mouseLeftButtonUp&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Events&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Mouse&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;LeftButtonUp&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;On&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;);&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
Or better yet, just remove the variable declarations altogether:&lt;!--EndFragment--&gt;&lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;draggingEvents&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;from&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;pos&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;in&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Events&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Mouse&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Move&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;On&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                             &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;SkipUntil&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Events&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Mouse&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;LeftButtonDown&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;On&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;))&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                             &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TakeUntil&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Events&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Mouse&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;LeftButtonUp&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;On&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;))&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                             &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Let&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;mm&lt;/span&gt; &lt;span style="color: silver"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;mm&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Zip&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;mm&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Skip&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;1&lt;/span&gt;), (&lt;span style="color: #eee8aa"&gt;prev&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;cur&lt;/span&gt;) &lt;span style="color: silver"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                 &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                 {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                     &lt;span style="color: #eee8aa"&gt;X2&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;cur&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;EventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetPosition&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;X&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                     &lt;span style="color: #eee8aa"&gt;X1&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;prev&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;EventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetPosition&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;X&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                     &lt;span style="color: #eee8aa"&gt;Y2&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;cur&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;EventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetPosition&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Y&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                     &lt;span style="color: #eee8aa"&gt;Y1&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;prev&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;EventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetPosition&lt;/span&gt;(&lt;span style="color: #40c4ff"&gt;this&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Y&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                                 }))&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Repeat&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                         &lt;span style="color: #40c4ff"&gt;select&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;pos&lt;/span&gt;;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
The Move, LeftButtonDown and LeftButtonUp members of the Events.Mouse class are readonly instances of the ObservableEvent&amp;lt;TTarget, TEventArgs&amp;gt; class that provide type-safe access to the events via the On() method.  Here is the code for the class:&lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;using&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;System&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;using&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;System&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Collections&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Generic&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;using&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;System&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Linq&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #40c4ff"&gt;namespace&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;System&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Linq&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Represents an event that can be managed via the &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="Observable"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; API.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TTarget"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the target.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;typeparam name="TEventArgs"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The type of the event args.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/typeparam&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ObservableEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TTarget&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;TEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;where&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;TEventArgs&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;EventArgs&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Initializes a new instance of the &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="ObservableEvent"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; class.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="eventName"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;Name of the event.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;protected&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;ObservableEvent&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;eventName&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #eee8aa"&gt;EventName&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;eventName&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Registers the specified event name.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="eventName"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;Name of the event.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ObservableEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TTarget&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;TEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Register&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;eventName&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ObservableEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TTarget&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;TEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;eventName&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Creates an enumerable sequence of event values for the specified target.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="target"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The target.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;IObservable&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;On&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;TTarget&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;target&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Observable&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FromEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;TEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;target&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;EventName&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Gets or sets the name of the event.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;value&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The name of the event.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;string&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;EventName&lt;/span&gt; { &lt;span style="color: #40c4ff"&gt;get&lt;/span&gt;; &lt;span style="color: #40c4ff"&gt;private&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;set&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;
&lt;p&gt;&lt;br /&gt;
And this is how it's used:&lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Categorizes &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="ObservableEvents"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; by class and/or functionality.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;partial&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Events&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;!--EndFragment--&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Implements a set of predefined &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="ObservableEvent"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;s&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; for the &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="System.Windows.System.Windows.UIElement"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; class&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; that represent mouse related events.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;partial&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Mouse&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;Represents the MouseMove event.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ObservableEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;UIElement&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MouseEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;Move&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #2b91af"&gt;ObservableEvent&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;UIElement&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;MouseEventArgs&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Register&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"MouseMove"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #ff80c0"&gt;// additional members omitted...&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;
&lt;p&gt;&lt;br /&gt;
The source code contains a static Events class with prefedined members for various categories (Key, Mouse, etc.).  There is also an Events.tt template that you can customize to generate additional event categories for any .NET type.  All you should have to do is add the name of your class to the types collection near the top of the template:&lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #eee8aa"&gt;types&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;Type&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #ff80c0"&gt;//{ "Microsoft.Maps.MapControl.Map, Microsoft.Maps.MapControl", null }&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        { &lt;span style="color: #60ff60"&gt;"System.Windows.FrameworkElement, System.Windows"&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt; },&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        { &lt;span style="color: #60ff60"&gt;"Whiteboard.MainPage, Whiteboard"&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt; }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    };&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;
&lt;p&gt;&lt;br /&gt;
The template is also a bit rough at this point, but at least it generates code that *should* compile.  Please let me know if you run into any issues with it.  Some people have reported errors when trying to use T4 templates within a Silverlight project, but I was able to get it to work with a little black magic... &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
You can &lt;a href="http://www.bmdiaz.com/Files/Whiteboard.zip"&gt;download the source code&lt;/a&gt; for this project or &lt;a href="http://www.bmdiaz.com/Whiteboard/"&gt;play around with the live demo&lt;/a&gt;.  Just be warned that it is at a very early stage so don't expect to find much today.  I plan on adding alot more options like pen colors and sizes, saving, printing, etc. as time permits.  &lt;strong&gt;HINT: &lt;/strong&gt;hold down the ESC key to erase!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Enjoy!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
Additional Resources&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.silverlightshow.net/items/Using-Reactive-Extensions-in-Silverlight.aspx"&gt;Using Reactive Extensions in Silverlight&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx"&gt;DevLabs: Reactive Extensions for .NET (Rx)&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://amazedsaint.blogspot.com/2009/11/linq-to-events-generating-wrapper.html"&gt;Rx Framework Part III - LINQ to Events - Generating GetEventName() Wrapper Methods using T4&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/138443.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/03/11/generate-strongly-typed-observable-events-for-the-reactive-extensions-for.aspx</guid>
            <pubDate>Thu, 11 Mar 2010 08:13:30 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/138443.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/03/11/generate-strongly-typed-observable-events-for-the-reactive-extensions-for.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/138443.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/138443.aspx</trackback:ping>
        </item>
        <item>
            <title>Adding Volcanos and Options - Earthquake Locator, part 2</title>
            <category>Silverlight</category>
            <category>RIA</category>
            <category>MVVM</category>
            <category>Bing Maps</category>
            <link>http://blog.bmdiaz.com/archive/2010/03/07/adding-volcanos-and-options---earthquake-locator-part-2.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;Quick Links&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://blog.bmdiaz.com/archive/2010/03/06/introducing-the-earthquake-locator--a-bing-maps-silverlight-application.aspx"&gt;Introducing the Earthquake Locator – A Bing Maps Silverlight Application, part 1&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.bmdiaz.com/EarthquakeLocator/"&gt;Live Demo&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.bmdiaz.com/Files/EarthquakeLocator.zip"&gt;Source Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;
Since volcanos are often associated with earthquakes, and vice versa, I decided to show recent volcanic activity on the Earthquake Locator map.  I am pulling the data from a website created for a joint project between the Smithsonian's Global Volcanism Program and the US Geological Survey's Volcano Hazards Program, &lt;a href="http://www.volcano.si.edu/reports/usgs/"&gt;found here&lt;/a&gt;.  They provide a Weekly Volcanic Activity Report as an RSS feed.&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;I started implementing this new functionality by creating a new Volcano entity in the domain model and adding the following to the EarthquakeService class (I also factored out the common reading/parsing helper methods to a separate FeedReader class that can be used by multiple domain service classes):&lt;br /&gt;
 &lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;private&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;readonly&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;string&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;VolcanoFeedUrl&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #2b91af"&gt;ConfigurationManager&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;AppSettings&lt;/span&gt;[&lt;span style="color: #60ff60"&gt;"VolcanoFeedUrl"&lt;/span&gt;];&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Gets the volcano data for the previous week.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;A queryable collection of &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="Volcano"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; objects.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;IQueryable&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Volcano&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;GetVolcanos&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;feed&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;FeedReader&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Load&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;VolcanoFeedUrl&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;list&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Volcano&lt;/span&gt;&lt;span style="color: silver"&gt;&amp;gt;&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: #eee8aa"&gt;feed&lt;/span&gt; &lt;span style="color: silver"&gt;!=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt; )&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #40c4ff"&gt;foreach&lt;/span&gt; ( &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;item&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;in&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;feed&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Items&lt;/span&gt; )&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;quake&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;CreateVolcano&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;item&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: #eee8aa"&gt;quake&lt;/span&gt; &lt;span style="color: silver"&gt;!=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt; )&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                        &lt;span style="color: #eee8aa"&gt;list&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Add&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;quake&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;list&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;AsQueryable&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Creates a &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="Volcano"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; object for each item in the RSS feed.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="item"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The RSS item.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;private&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Volcano&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;CreateVolcano&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;SyndicationItem&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;item&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #2b91af"&gt;Volcano&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;volcano&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;string&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;title&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;item&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Title&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;string&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;desc&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;item&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Summary&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;double&lt;/span&gt;&lt;span style="color: silver"&gt;?&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;latitude&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;double&lt;/span&gt;&lt;span style="color: silver"&gt;?&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;longitude&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #2b91af"&gt;FeedReader&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetGeoRssPoint&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;item&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;out&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;latitude&lt;/span&gt;, &lt;span style="color: #40c4ff"&gt;out&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;longitude&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: silver"&gt;!&lt;/span&gt;&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsNullOrEmpty&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;title&lt;/span&gt;) )&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #eee8aa"&gt;title&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;title&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Substring&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;0&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;title&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IndexOf&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;'-'&lt;/span&gt;));&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: silver"&gt;!&lt;/span&gt;&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsNullOrEmpty&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;desc&lt;/span&gt;) )&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #eee8aa"&gt;desc&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Join&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"\n\n"&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;desc&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                        &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Replace&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"&amp;lt;p&amp;gt;"&lt;/span&gt;, &lt;span style="color: #60ff60"&gt;""&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                        &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Split&lt;/span&gt;(&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                            &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;string&lt;/span&gt;[] { &lt;span style="color: #60ff60"&gt;"&amp;lt;/p&amp;gt;"&lt;/span&gt; },&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                            &lt;span style="color: #2b91af"&gt;StringSplitOptions&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;RemoveEmptyEntries&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                        &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Select&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;s&lt;/span&gt; &lt;span style="color: silver"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;s&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Trim&lt;/span&gt;())&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                        &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ToArray&lt;/span&gt;())&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                        &lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Trim&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: #eee8aa"&gt;latitude&lt;/span&gt; &lt;span style="color: silver"&gt;!=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt; &lt;span style="color: silver"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;longitude&lt;/span&gt; &lt;span style="color: silver"&gt;!=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt; )&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #eee8aa"&gt;volcano&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Volcano&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #eee8aa"&gt;Id&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;item&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Id&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #eee8aa"&gt;Title&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;title&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #eee8aa"&gt;Description&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;desc&lt;/span&gt;,&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #eee8aa"&gt;Url&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;item&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Links&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Select&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;l&lt;/span&gt; &lt;span style="color: silver"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;l&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Uri&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;OriginalString&lt;/span&gt;)&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FirstOrDefault&lt;/span&gt;(),&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #eee8aa"&gt;Latitude&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;latitude&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetValueOrDefault&lt;/span&gt;(),&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                    &lt;span style="color: #eee8aa"&gt;Longitude&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;longitude&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;GetValueOrDefault&lt;/span&gt;()&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                };&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;volcano&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;
&lt;p&gt;&lt;br /&gt;
I then added the corresponding LoadVolcanos() method and Volcanos collection to the EarthquakeViewModel class in much the same way I did with the Earthquakes in my &lt;a href="http://blog.bmdiaz.com/archive/2010/03/06/introducing-the-earthquake-locator--a-bing-maps-silverlight-application.aspx"&gt;previous article in this series&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now that I am starting to add more information to the map, I wanted to give the user some options as to what is displayed and allowing them to choose what gets turned off.  I have updated the MainPage.xaml to look like this:&lt;br /&gt;
 &lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;UserControl &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;x:Class&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;EarthquakeLocator.MainPage&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;xmlns&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;xmlns:x&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;xmlns:d&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;http://schemas.microsoft.com/expression/blend/2008&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;xmlns:mc&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;http://schemas.openxmlformats.org/markup-compatibility/2006&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;xmlns:basic&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;xmlns:bing&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;xmlns:vm&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;clr-namespace:EarthquakeLocator.ViewModel&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;mc:Ignorable&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;d&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;d:DesignWidth&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;640&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;d:DesignHeight&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;480&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;UserControl.Resources&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;DataTemplate &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;x:Key&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;EarthquakeTemplate&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;Ellipse &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Fill&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Red&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Stroke&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Black&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;StrokeThickness&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;1&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                     &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Width&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Size}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Height&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Size}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                     &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;bing:MapLayer.Position&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Location}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                     &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;bing:MapLayer.PositionOrigin&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Center&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                &amp;lt;ToolTipService.ToolTip&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;StackPanel&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;TextBlock &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Title}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FontSize&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;14&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FontWeight&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Bold&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;TextBlock &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding UtcTime}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;TextBlock &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding LocalTime}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;TextBlock &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding DepthDesc}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;/StackPanel&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                &amp;lt;/ToolTipService.ToolTip&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;/Ellipse&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;/DataTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;DataTemplate &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;x:Key&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;VolcanoTemplate&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;Polygon &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Fill&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Gold&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Stroke&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Black&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;StrokeThickness&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;1&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Points&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;0,10 5,0 10,10&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                     &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;bing:MapLayer.Position&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Location}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                     &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;bing:MapLayer.PositionOrigin&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Center&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                     &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;MouseLeftButtonUp&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Volcano_MouseLeftButtonUp&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                &amp;lt;ToolTipService.ToolTip&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;StackPanel&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;TextBlock &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Title}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FontSize&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;14&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FontWeight&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Bold&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;TextBlock &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Click icon for more information...&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;/StackPanel&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                &amp;lt;/ToolTipService.ToolTip&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;/Polygon&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;/DataTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;/UserControl.Resources&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;UserControl.DataContext&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;vm:EarthquakeViewModel &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;AutoLoadData&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;True&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;/UserControl.DataContext&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;Grid &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;x:Name&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;LayoutRoot&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;bing:Map &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;x:Name&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;map&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;CredentialsProvider&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;--Your-Bing-Maps-Key--&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Center&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding MapCenter, Mode=TwoWay}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ZoomLevel&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding ZoomLevel, Mode=TwoWay}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;bing:MapItemsControl &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ItemsSource&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Earthquakes}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{StaticResource EarthquakeTemplate}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;bing:MapItemsControl &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ItemsSource&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Volcanos}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{StaticResource VolcanoTemplate}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;/bing:Map&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;basic:TabControl &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;x:Name&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;tabs&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Bottom&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;MaxHeight&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;25&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Opacity&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;0.7&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;basic:TabItem &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Margin&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;90,0,-90,0&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;MouseLeftButtonUp&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;TabItem_MouseLeftButtonUp&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                &amp;lt;basic:TabItem.Header&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;TextBlock &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;x:Name&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;txtHeader&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Options&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #eee8aa"&gt;                               FontSize&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;13&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FontWeight&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Bold&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                &amp;lt;/basic:TabItem.Header&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                &amp;lt;StackPanel &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Orientation&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Horizontal&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;TextBlock &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Earthquakes:&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FontWeight&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Bold&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Margin&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;3&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;StackPanel &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Margin&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;3&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;CheckBox &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Content&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;&amp;amp;lt;&lt;/span&gt;&lt;span style="color: #60ff60"&gt; 4.0&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsChecked&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding ShowLt4, Mode=TwoWay}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;CheckBox &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Content&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;4.0 - 4.9&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsChecked&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Show4s, Mode=TwoWay}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;CheckBox &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Content&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;5.0 - 5.9&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsChecked&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Show5s, Mode=TwoWay}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;/StackPanel&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;StackPanel &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Margin&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;10,3,3,3&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;CheckBox &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Content&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;6.0 - 6.9&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsChecked&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Show6s, Mode=TwoWay}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;CheckBox &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Content&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;7.0 - 7.9&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsChecked&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding Show7s, Mode=TwoWay}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;CheckBox &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Content&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;8.0 +&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsChecked&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding ShowGe8, Mode=TwoWay}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;/StackPanel&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;TextBlock &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Text&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Other:&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;FontWeight&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Bold&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Margin&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;50,3,3,3&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;StackPanel &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Margin&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;3&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                        &amp;lt;CheckBox &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Content&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;Volcanos&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #eee8aa"&gt;                                  &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsChecked&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;{Binding ShowVolcanos, Mode=TwoWay}&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                    &amp;lt;/StackPanel&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;                &amp;lt;/StackPanel&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;            &amp;lt;/basic:TabItem&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;/basic:TabControl&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;/Grid&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;&amp;lt;/UserControl&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;
&lt;p&gt;&lt;br /&gt;
Notice that I added a VolcanoTemplate that uses a triangle-shaped Polygon to represent the Volcano locations, and I also added a second &amp;lt;bing:MapItemsControl /&amp;gt; tag to the map to bind to the Volcanos collection.  The TabControl found below the map houses the options panel that will present the user with several checkboxes so they can filter the different points based on type and other properties (i.e. Magnitude).  Initially, the TabItem is collapsed to reduce it's footprint, but the screen shot below shows the options panel expanded to reveal the available settings:&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;&lt;img height="480" alt="" width="601" src="http://geekswithblogs.net/images/geekswithblogs_net/bdiaz/11301/r_07.OptionsPanel.png" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I have updated the &lt;a href="http://www.bmdiaz.com/Files/EarthquakeLocator.zip"&gt;Source Code&lt;/a&gt; and &lt;a href="http://www.bmdiaz.com/EarthquakeLocator"&gt;Live Demo&lt;/a&gt; to include these new features.&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;Happy Mapping!&lt;/p&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/138382.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/03/07/adding-volcanos-and-options---earthquake-locator-part-2.aspx</guid>
            <pubDate>Mon, 08 Mar 2010 01:40:21 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/138382.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/03/07/adding-volcanos-and-options---earthquake-locator-part-2.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/138382.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/138382.aspx</trackback:ping>
        </item>
        <item>
            <title>Earthquake Locator - Live Demo and Source Code</title>
            <category>Silverlight</category>
            <category>RIA</category>
            <category>MVVM</category>
            <category>Bing Maps</category>
            <link>http://blog.bmdiaz.com/archive/2010/03/07/earthquake-locator---live-demo-and-source-code.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;Quick Links&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://blog.bmdiaz.com/archive/2010/03/06/introducing-the-earthquake-locator--a-bing-maps-silverlight-application.aspx"&gt;Introducing the Earthquake Locator – A Bing Maps Silverlight Application, part 1&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://blog.bmdiaz.com/archive/2010/03/07/adding-volcanos-and-options---earthquake-locator-part-2.aspx"&gt;Adding Volcanos and Options - Earthquake Locator, part 2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.bmdiaz.com/EarthquakeLocator/"&gt;Live Demo&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.bmdiaz.com/Files/EarthquakeLocator.zip"&gt;Source Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;
I finally got a live demo up and running!  I signed up for a shared hosting account over at &lt;a href="http://www.discountasp.net/index.aspx?refcode=BMDIAZ"&gt;discountasp.net&lt;/a&gt; so I could post a working version of the Earthquake Locator application, but ran into a few minor issues related to RIA Services.  Thankfully, &lt;a href="http://timheuer.com/blog/"&gt;Tim Heuer&lt;/a&gt; had already encountered and explained all of the problems I had along with solutions to these and other common pitfalls.  &lt;a href="http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx"&gt;You can find his blog post here&lt;/a&gt;.  The ones that got me were the default authentication tag being set to Windows instead of Forms, needed to add the &amp;lt;baseAddressPrefixFilters&amp;gt; tag since I was running on a shared server using host headers, and finally the Multiple Authentication Schemes settings in the IIS7 Manager.&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;To get the demo application ready, I pulled down local copies of the earthquake data feeds that the application can use instead of pulling from the USGS web site.  I basically added the feed URL as an app setting in the web.config:&lt;br /&gt;
 &lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;appSettings&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;!--&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; USGS Data Feeds: http://earthquake.usgs.gov/earthquakes/catalogs/ &lt;/span&gt;&lt;span style="color: #ff8000"&gt;--&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;!--&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;&amp;lt;add key="FeedUrl" &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff80c0"&gt;            value="http://earthquake.usgs.gov/earthquakes/catalogs/1day-M2.5.xml" /&amp;gt;&lt;/span&gt;&lt;span style="color: #ff8000"&gt;--&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;!--&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;&amp;lt;add key="FeedUrl" &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff80c0"&gt;            value="http://earthquake.usgs.gov/earthquakes/catalogs/7day-M2.5.xml" /&amp;gt;&lt;/span&gt;&lt;span style="color: #ff8000"&gt;--&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;!--&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;&amp;lt;add key="FeedUrl" &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff80c0"&gt;            value="~/Demo/1day-M2.5.xml" /&amp;gt;&lt;/span&gt;&lt;span style="color: #ff8000"&gt;--&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;        &amp;lt;add &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;key&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;FeedUrl&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;             &lt;/span&gt;&lt;span style="color: #eee8aa"&gt;value&lt;/span&gt;&lt;span style="color: #ff8000"&gt;=&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #60ff60"&gt;~/Demo/7day-M2.5.xml&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;"&lt;/span&gt;&lt;span style="color: #ff8000"&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;&lt;span style="color: #ff8000"&gt;    &amp;lt;/appSettings&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;&lt;!--EndFragment--&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
You will need to do the same if you want to run from local copies of the feed data.  I also made the following minor changes to the EarthquakeService class so that it gets the FeedUrl from the web.config:&lt;br /&gt;
 &lt;/p&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;div style="font-size: 8pt; background: #171717; color: yellow; font-family: Consolas"&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;private&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;readonly&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;string&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;FeedUrl&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ConfigurationManager&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;AppSettings&lt;/span&gt;[&lt;span style="color: #60ff60"&gt;"FeedUrl"&lt;/span&gt;];&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; Gets the feed at the specified URL.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;param name="url"&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;The URL.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #adadad"&gt;///&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt;A &lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;see cref="SyndicationFeed"/&amp;gt;&lt;/span&gt;&lt;span style="color: #ff80c0"&gt; object.&lt;/span&gt;&lt;span style="color: #adadad"&gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    &lt;span style="color: #40c4ff"&gt;public&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SyndicationFeed&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;GetFeed&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;String&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;url&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #2b91af"&gt;SyndicationFeed&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;feed&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #40c4ff"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;if&lt;/span&gt; ( &lt;span style="color: silver"&gt;!&lt;/span&gt;&lt;span style="color: #2b91af"&gt;String&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;IsNullOrEmpty&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;url&lt;/span&gt;) &lt;span style="color: silver"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;url&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;StartsWith&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"~"&lt;/span&gt;) )&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #ff80c0"&gt;// resolve virtual path to physical file system&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #eee8aa"&gt;url&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;System&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Web&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #2b91af"&gt;HttpContext&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Current&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Server&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;MapPath&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;url&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;try&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #eee8aa"&gt;log&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Debug&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"Loading RSS feed: "&lt;/span&gt; &lt;span style="color: silver"&gt;+&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;url&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #40c4ff"&gt;using&lt;/span&gt; ( &lt;span style="color: #40c4ff"&gt;var&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;reader&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;XmlReader&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Create&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;url&lt;/span&gt;) )&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;                &lt;span style="color: #eee8aa"&gt;feed&lt;/span&gt; &lt;span style="color: silver"&gt;=&lt;/span&gt; &lt;span style="color: #2b91af"&gt;SyndicationFeed&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Load&lt;/span&gt;(&lt;span style="color: #eee8aa"&gt;reader&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;catch&lt;/span&gt; ( &lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;ex&lt;/span&gt; )&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;            &lt;span style="color: #eee8aa"&gt;log&lt;/span&gt;&lt;span style="color: silver"&gt;.&lt;/span&gt;&lt;span style="color: #eee8aa"&gt;Error&lt;/span&gt;(&lt;span style="color: #60ff60"&gt;"Error occurred while loading RSS feed: "&lt;/span&gt; &lt;span style="color: silver"&gt;+&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;url&lt;/span&gt;, &lt;span style="color: #eee8aa"&gt;ex&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt; &lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;        &lt;span style="color: #40c4ff"&gt;return&lt;/span&gt; &lt;span style="color: #eee8aa"&gt;feed&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px; line-height: 14px"&gt;    }&lt;/p&gt;
&lt;/div&gt;
&lt;!--EndFragment--&gt;&lt;!--EndFragment--&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;
You can now &lt;a href="http://www.bmdiaz.com/EarthquakeLocator/"&gt;view the live demo&lt;/a&gt; or &lt;a href="http://www.bmdiaz.com/Files/EarthquakeLocator.zip"&gt;download the source code here&lt;/a&gt;, but be sure you have WCF RIA Services installed before running the application locally and make sure the FeedUrl is pointing to a valid location.  Please let me know if you have any comments or if you run into any issues with the code.&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt; &lt;img src="http://blog.bmdiaz.com/aggbug/138379.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bobby Diaz</dc:creator>
            <guid>http://blog.bmdiaz.com/archive/2010/03/07/earthquake-locator---live-demo-and-source-code.aspx</guid>
            <pubDate>Sun, 07 Mar 2010 19:59:34 GMT</pubDate>
            <wfw:comment>http://blog.bmdiaz.com/comments/138379.aspx</wfw:comment>
            <comments>http://blog.bmdiaz.com/archive/2010/03/07/earthquake-locator---live-demo-and-source-code.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blog.bmdiaz.com/comments/commentRss/138379.aspx</wfw:commentRss>
            <trackback:ping>http://blog.bmdiaz.com/services/trackbacks/138379.aspx</trackback:ping>
        </item>
    </channel>
</rss>
