<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>AlanO's Blog</title>
        <link>http://aocampo.com/Blog/Default.aspx</link>
        <description>"I Heart Code"</description>
        <language>en-US</language>
        <copyright>Alan Ocampo</copyright>
        <managingEditor>alan@aocampo.com</managingEditor>
        <generator>Subtext Version 1.9.5.176</generator>
        <image>
            <title>AlanO's Blog</title>
            <url>http://aocampo.com/Blog/images/RSS2Image.gif</url>
            <link>http://aocampo.com/Blog/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>First Look: Cooliris &amp;ndash; &amp;lsquo;Enjoy the richest way to view photos from Flickr, Facebook, Picasa, and even your computer.&amp;rsquo;</title>
            <category>Software</category>
            <link>http://aocampo.com/Blog/archive/2010/01/16/first-look-cooliris-ndash-lsquoenjoy-the-richest-way-to-view.aspx</link>
            <description>&lt;p&gt;I was upgrading Firefox on one of my computers last night and stumbled upon &lt;a href="http://www.cooliris.com/" target="_blank"&gt;Cooliris&lt;/a&gt; as a featured add-on. From the Cooliris website:&lt;/p&gt;  &lt;blockquote&gt;   &lt;h4&gt;What is Cooliris?&lt;/h4&gt;    &lt;p&gt;It's simply the fastest and most stunning way to browse photos and videos from the Web or your desktop. Effortlessly scroll an infinite "3D Wall" of your content without having to click page to page, whether you'e on Facebook, Google Images, YouTube, Flickr, Picasa, Kodak Gallery, or any supported site. Or channel surf the latest news, TV episodes, movies, and music videos all from within Cooliris.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I was very impressed with my first experience with Cooliris as, coincidentally, I was recently planning to write a Silverlight slideshow control that could present a Picasa web album. Cooliris already has this feature built-in, among many others (such as displaying images from other web sites and search engines). In addition to their desktop support, I was also glad to learn about their support for mobile platforms as well, especially their support for Android (the media gallery app is included as the official media app for the Nexus One (looking forward to getting my phone upgraded to Android 2.1 :))).&lt;/p&gt;  &lt;p&gt;Check out the &lt;a href="http://www.cooliris.com/express/" target="_blank"&gt;Cooliris Express&lt;/a&gt; tool on the Cooliris website to quickly build an embeddable 3D wall of pictures (such as my Picasa web albums displayed below) for your blog or site. &lt;/p&gt;  &lt;p&gt;&lt;object id="ci_03022_o" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="300"&gt;&lt;param name="movie" value="http://apps.cooliris.com/embed/cooliris.swf" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="bgColor" value="#121212" /&gt;&lt;param name="flashvars" value="feed=api%3A%2F%2Fpicasaweb.google.com%2F%3Fuser%3DAlanMOcampo&amp;amp;backgroundcolor=%23191d25&amp;amp;glowcolor=%23BABABA&amp;amp;numrows=2" /&gt;&lt;param name="wmode" value="opaque" /&gt;&lt;embed id="ci_03022_e" type="application/x-shockwave-flash" src="http://apps.cooliris.com/embed/cooliris.swf" width="400" height="248" allowfullscreen="true" allowscriptaccess="always" bgcolor="#121212" flashvars="feed=api%3A%2F%2Fpicasaweb.google.com%2F%3Fuser%3DAlanMOcampo&amp;amp;backgroundcolor=%23191d25&amp;amp;glowcolor=%23BABABA&amp;amp;numrows=2" wmode="opaque"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:dba951d3-857c-4da3-ae22-218a415e1a0e" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Cooliris" rel="tag"&gt;Cooliris&lt;/a&gt;&lt;/div&gt;&lt;img src="http://aocampo.com/Blog/aggbug/221.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2010/01/16/first-look-cooliris-ndash-lsquoenjoy-the-richest-way-to-view.aspx</guid>
            <pubDate>Sun, 17 Jan 2010 02:35:37 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/221.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2010/01/16/first-look-cooliris-ndash-lsquoenjoy-the-richest-way-to-view.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/221.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Uninstalling PVConnect Add-In from Windows Home Server May Improve Console Performance</title>
            <category>General</category>
            <link>http://aocampo.com/Blog/archive/2009/10/24/uninstalling-pvconnect-add-in-from-windows-home-server-may-improve-console.aspx</link>
            <description>&lt;p&gt;I have been putting up with a very slow Windows Home Server Console for a long time now (at least six months). The console response time to clicks and its window refresh rate have been very slow; as in, I would have to wait minutes for the response to a button click to complete. Today, I had to work with the console for a long time and I just got fed up with the problem. A quick search on the web fixed my problem, thanks to the MS Windows Home Server forum. I had to uninstall the PVConnect add-in (which I do not use anyway). The console is now as responsive as when I first got my WHS.&lt;/p&gt;  &lt;p&gt;Link: &lt;a href="http://social.microsoft.com/forums/en-US/whssoftware/thread/ee1cc7b8-8a3e-4652-bf38-ba6b19c0745f" target="_blank"&gt;WHS Console keeps freezing - PAINFULLY slow&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:98eb5bb8-566a-4b68-b250-7513dc69c591" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Windows+Home+Server" rel="tag"&gt;Windows Home Server&lt;/a&gt;&lt;/div&gt;&lt;img src="http://aocampo.com/Blog/aggbug/219.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2009/10/24/uninstalling-pvconnect-add-in-from-windows-home-server-may-improve-console.aspx</guid>
            <pubDate>Sat, 24 Oct 2009 21:36:24 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/219.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2009/10/24/uninstalling-pvconnect-add-in-from-windows-home-server-may-improve-console.aspx#feedback</comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/219.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Configuring Silverlight Service References Using &amp;lsquo;initParams&amp;rsquo; (C#)</title>
            <category>Software Development</category>
            <link>http://aocampo.com/Blog/archive/2009/09/06/configuring-silverlight-lsquoservicereferences.clientconfigrsquo-using-lsquoinitparamsrsquo-c.aspx</link>
            <description>&lt;p&gt;Silverlight cannot easily be configured to use a different endpoint address via a configuration setting. Unlike other .Net application types that can be configured upon deployment using their ‘.config’ files (for Windows apps, it is the ‘app.config’ file, and for web apps it is the ‘web.config’ file), Silverlight applications need to be configured before deployment using the ‘ServiceReferences.ClientConfig’ file. This has been very inconvenient for me so I had to come up with a simple solution to this problem.&lt;/p&gt;  &lt;p&gt;My solution to the problem involves the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Set the configuration settings in the &lt;em&gt;initParams&lt;/em&gt; initialization parameter of the Silverlight plug-in object. A typical Silverlight &lt;em&gt;object&lt;/em&gt; tag in my web page would then look like: &lt;/li&gt; &lt;/ul&gt;  &lt;pre class="code"&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;object&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;data&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="data:application/x-silverlight-2,"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="application/x-silverlight-2"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;width&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="100%"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;height&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="100%"
&lt;/span&gt;            &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="silverlightControl"&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="source"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ClientBin/MyApp.xap"/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="onError"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="onSilverlightError"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="background"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="white"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="minRuntimeVersion"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="3.0.40624.0"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="autoUpgrade"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="true"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;          &lt;strong&gt;&lt;font size="3"&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="initParams"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="EndpointHost=localhost,EndpointPort=51324"&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt;&lt;span style="color: rgb(0,0,255)"&gt;&lt;strong&gt;&lt;font size="3"&gt;/&amp;gt;&lt;/font&gt;&lt;/strong&gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;a&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;href&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="http://go.microsoft.com/fwlink/?LinkID=149156&amp;amp;v=3.0.40624.0"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;text-decoration&lt;/span&gt;:&lt;span style="color: rgb(0,0,255)"&gt;none"&amp;gt;
&lt;/span&gt;               &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;img&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;src&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="http://go.microsoft.com/fwlink/?LinkId=108181"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;alt&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Get Microsoft Silverlight"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;border-style&lt;/span&gt;:&lt;span style="color: rgb(0,0,255)"&gt;none"/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;a&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;object&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;ul&gt;
  &lt;li&gt;In the &lt;em&gt;App&lt;/em&gt; class’s  &lt;em&gt;Startup&lt;/em&gt; event, generate the endpoint for the service by parsing &lt;em&gt;initParams&lt;/em&gt;. The following code contains three methods that take care of this: &lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="code"&gt;        &lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;EndpointAddress&lt;/span&gt; m_endpointAddress;&lt;/pre&gt;

&lt;pre class="code"&gt;        &lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; Application_Startup(&lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43,145,175)"&gt;StartupEventArgs&lt;/span&gt; e)
        {
            &lt;span style="color: rgb(0,128,0)"&gt;//get the endpoint for the web service
&lt;/span&gt;            &lt;span style="color: rgb(0,128,0)"&gt;//as specified in InitParams
&lt;/span&gt;            &lt;span style="color: rgb(43,145,175)"&gt;AppServicesSoapClient&lt;/span&gt; client = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;AppServicesSoapClient&lt;/span&gt;();
            &lt;span style="color: rgb(43,145,175)"&gt;Uri&lt;/span&gt; serviceUri = GetServiceUriFromInitParams(e.InitParams, client.Endpoint.Address.Uri);
            m_endpointAddress = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;EndpointAddress&lt;/span&gt;(serviceUri, client.Endpoint.Address.Headers.ToArray());
        }

        &lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Uri&lt;/span&gt; GetServiceUriFromInitParams(&lt;span style="color: rgb(43,145,175)"&gt;IDictionary&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;, &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;&amp;gt; initParams, &lt;span style="color: rgb(43,145,175)"&gt;Uri&lt;/span&gt; referenceUri)
        {
            &lt;span style="color: rgb(43,145,175)"&gt;UriBuilder&lt;/span&gt; uriBuilder = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;UriBuilder&lt;/span&gt;(referenceUri);
            &lt;span style="color: rgb(0,0,255)"&gt;foreach&lt;/span&gt; (&lt;span style="color: rgb(43,145,175)"&gt;KeyValuePair&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;, &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;&amp;gt; initParam &lt;span style="color: rgb(0,0,255)"&gt;in&lt;/span&gt; initParams)
            {
                &lt;span style="color: rgb(0,0,255)"&gt;switch&lt;/span&gt; (initParam.Key.ToLower())
                {
                    &lt;span style="color: rgb(0,0,255)"&gt;case&lt;/span&gt; &lt;span style="color: rgb(163,21,21)"&gt;"endpointhost"&lt;/span&gt;:
                        uriBuilder.Host = initParam.Value;
                        &lt;span style="color: rgb(0,0,255)"&gt;break&lt;/span&gt;;
                    &lt;span style="color: rgb(0,0,255)"&gt;case&lt;/span&gt; &lt;span style="color: rgb(163,21,21)"&gt;"endpointport"&lt;/span&gt;:
                        uriBuilder.Port = &lt;span style="color: rgb(43,145,175)"&gt;Convert&lt;/span&gt;.ToInt32(initParam.Value);
                        &lt;span style="color: rgb(0,0,255)"&gt;break&lt;/span&gt;;
                    &lt;span style="color: rgb(0,0,255)"&gt;case&lt;/span&gt; &lt;span style="color: rgb(163,21,21)"&gt;"endpointpath"&lt;/span&gt;:
                        uriBuilder.Path = initParam.Value;
                        &lt;span style="color: rgb(0,0,255)"&gt;break&lt;/span&gt;;
                }
            }
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; uriBuilder.Uri;
        }&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;pre class="code"&gt;        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;AppServicesSoapClient&lt;/span&gt; GetAppServicesClient()
        {
            &lt;span style="color: rgb(43,145,175)"&gt;AppServicesSoapClient&lt;/span&gt; client = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;AppServicesSoapClient&lt;/span&gt;();
            client.Endpoint.Address = m_endpointAddress;
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; client;
        }&lt;/pre&gt;

&lt;p&gt;Some notes about the code above:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The &lt;em&gt;m_endpointAddress&lt;/em&gt; member variable is used to contain the endpoint address resolved from &lt;em&gt;initParams&lt;/em&gt;. &lt;/li&gt;

  &lt;li&gt;The &lt;em&gt;Application_Startup&lt;/em&gt; event handler generates the value for the endpoint address. It uses a default instance of a service client to get the default endpoint URI. It then calls &lt;em&gt;GetServiceUriFromInitParams&lt;/em&gt; to get a URI configured with the parsed values of &lt;em&gt;initParams&lt;/em&gt;. &lt;/li&gt;

  &lt;li&gt;The &lt;em&gt;GetServiceUriFromInitParams&lt;/em&gt; method generates a URI using a reference URI (the default service endpoint URI, in this case). It parses &lt;em&gt;initParams&lt;/em&gt; to find keys of interest to replace parts of the URI with the specified values. The sample uses &lt;em&gt;host&lt;/em&gt;, &lt;em&gt;port&lt;/em&gt;, and &lt;em&gt;path&lt;/em&gt; only (for most of my apps, host and port are sufficient) but the method can easily be extended to handle the other parts of a URI using the same technique. The &lt;em&gt;UriBuilder&lt;/em&gt; class provides the crucial services for easily constructing the URI from a base value and replacing its parts with the new values. &lt;/li&gt;

  &lt;li&gt;The &lt;em&gt;GetAppServicesClient&lt;/em&gt; method serves as the application-wide method for instantiating clients configured with the desired endpoint. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For ASP .Net hosting applications, the solution can be extended to store the configuration setting in the web.config file. Sample ‘web.config’ &lt;em&gt;appSettings&lt;/em&gt; and Silverlight &lt;em&gt;object&lt;/em&gt; tags follow:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;appSettings&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;add&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;key&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;ServiceEndpointParams&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;EndpointHost=localhost,EndpointPort=51324&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;appSettings&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;pre class="code"&gt;       &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;object&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;data&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="data:application/x-silverlight-2,"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="application/x-silverlight-2"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;width&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="100%"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;height&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="100%"
&lt;/span&gt;            &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="silverlightControl"&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="source"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ClientBin/SpellingVee.xap"/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="onError"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="onSilverlightError"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="background"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="white"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="minRuntimeVersion"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="3.0.40624.0"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="autoUpgrade"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="true"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;param&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="initParams"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="&lt;/span&gt;&lt;span style="background: rgb(255,238,98)"&gt;&amp;lt;%&lt;/span&gt;=System.Configuration.ConfigurationManager.AppSettings["ServiceEndpointParams"] &lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;a&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;href&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="http://go.microsoft.com/fwlink/?LinkID=149156&amp;amp;v=3.0.40624.0"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;text-decoration&lt;/span&gt;:&lt;span style="color: rgb(0,0,255)"&gt;none"&amp;gt;
&lt;/span&gt;               &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;img&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;src&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="http://go.microsoft.com/fwlink/?LinkId=108181"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;alt&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Get Microsoft Silverlight"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;border-style&lt;/span&gt;:&lt;span style="color: rgb(0,0,255)"&gt;none"/&amp;gt;
&lt;/span&gt;          &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;a&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;       &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;object&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;A simpler solution using the same technique is to specify the full URL in &lt;em&gt;initParams&lt;/em&gt; (which is the same approach implemented in ‘web.config’ and ‘app.config’ files), instead of just parts of it. However, I like this solution better as most of the time only the host and port will be different between my development and production endpoints (this avoids having to remember the full URL).&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7e9349e0-03e8-4ebe-98d2-82f5fffcb2c9" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;, &lt;a href="http://technorati.com/tags/ServiceReferences.ClientConfig" rel="tag"&gt;ServiceReferences.ClientConfig&lt;/a&gt;, &lt;a href="http://technorati.com/tags/C%23" rel="tag"&gt;C#&lt;/a&gt;&lt;/div&gt;&lt;img src="http://aocampo.com/Blog/aggbug/217.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2009/09/06/configuring-silverlight-lsquoservicereferences.clientconfigrsquo-using-lsquoinitparamsrsquo-c.aspx</guid>
            <pubDate>Mon, 07 Sep 2009 02:09:11 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/217.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2009/09/06/configuring-silverlight-lsquoservicereferences.clientconfigrsquo-using-lsquoinitparamsrsquo-c.aspx#feedback</comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/217.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Sample Code: Integrating Picasa Web Albums into an ASP.NET Application</title>
            <category>Software Development</category>
            <link>http://aocampo.com/Blog/archive/2009/07/11/sample-code-integrating-picasa-web-albums-into-an-asp.net-application.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/SampleCodeIntegratingPica.NETApplication_599/image_8.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Picasa Web Integration" border="0" alt="Picasa Web Integration" align="right" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/SampleCodeIntegratingPica.NETApplication_599/image_thumb_3.png" width="244" height="192" /&gt;&lt;/a&gt; I have come up with a sample Visual Studio 2008 (C#) web application project integrating Picasa Web Albums into an ASP.NET website. I blogged on this subject last year (see &lt;a href="http://aocampo.com/Blog/archive/2008/07/30/integrating-picasa-web-albums-into-my-website.aspx"&gt;Integrating Picasa Web Albums into my Website&lt;/a&gt;) and am providing sample code as I have recently received a request for this. Much of the solution comes from code I actually use on my website, including the theme/style of the page (based on the &lt;a href="http://www.asp.net/downloads/starter-kits/personal/" target="_blank"&gt;Personal Web Site Starter Kit&lt;/a&gt; which I used as a starting point when I rebuilt my website a few years ago). You can download the solution at: &lt;a href="http://www.aocampo.com/Downloads/PicasaWebIntegration.zip"&gt;http://www.aocampo.com/Downloads/PicasaWebIntegration.zip&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Main Project Components&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Pages      &lt;ul&gt;       &lt;li&gt;&lt;em&gt;Default.aspx&lt;/em&gt; – displays albums (as in the screenshot above) &lt;/li&gt;        &lt;li&gt;&lt;em&gt;Slideshow.aspx&lt;/em&gt; – displays an album’s slideshow using an embedded Picasa Web Album. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Class Files      &lt;ul&gt;       &lt;li&gt;&lt;em&gt;Album.cs&lt;/em&gt; – a class file for the &lt;em&gt;Album&lt;/em&gt; class, an abstraction of a Picasa Web Album. &lt;/li&gt;        &lt;li&gt;&lt;em&gt;PhotoManager.cs&lt;/em&gt; = a class file for the &lt;em&gt;PhotoManager&lt;/em&gt; class that wraps the Google Data API services. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Deployment Notes&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Before running the project, replace the value for the &lt;em&gt;PicasaWebUserId&lt;/em&gt; application setting in the &lt;em&gt;web.config&lt;/em&gt; file to the Picasa Web Album ID that you want to use. &lt;/li&gt;    &lt;li&gt;To optimize performance, the &lt;em&gt;PhotoManager&lt;/em&gt; gets the list of albums associated with a specified account the first time the album list is needed and uses the same list for all subsequent requests until the application is restarted. This means that when the albums are updated (say, a new album was added), the albums displayed will not be refreshed. This is usually sufficient for low traffic websites (like mine) as the web application shuts down periodically on idle (so the &lt;em&gt;PhotoManager&lt;/em&gt; will likely refresh the album list at least once a day). To force a refresh of the albums list, pass a ‘&lt;em&gt;reset=y&lt;/em&gt;’ query string to the page (e.g., navigate to ‘&lt;em&gt;Default.aspx?reset=y&lt;/em&gt;’).  &lt;/li&gt; &lt;/ol&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e589f573-da5c-4b68-b36a-76154a6732e8" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Picasa+Web+Albums+API" rel="tag"&gt;Picasa Web Albums API&lt;/a&gt;, &lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Downloads" rel="tag"&gt;Downloads&lt;/a&gt;&lt;/div&gt;&lt;img src="http://aocampo.com/Blog/aggbug/213.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2009/07/11/sample-code-integrating-picasa-web-albums-into-an-asp.net-application.aspx</guid>
            <pubDate>Sat, 11 Jul 2009 05:04:50 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/213.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2009/07/11/sample-code-integrating-picasa-web-albums-into-an-asp.net-application.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/213.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Sample Code: Data Virtualization Using a Web Service with Xceed DataGrid for WPF</title>
            <category>Software Development</category>
            <link>http://aocampo.com/Blog/archive/2009/07/01/sample-code-data-virtualization-using-a-web-service-with-xceed.aspx</link>
            <description>&lt;p&gt;I got a few requests for sample code to my post about &lt;a href="http://aocampo.com/Blog/archive/2009/03/30/data-virtualization-with-xceed-datagrid-for-wpf.aspx" target="_blank"&gt;Data Virtualization with Xceed DataGrid for WPF&lt;/a&gt;. I have come up with a sample Visual Studio 2008 solution for this. You can download the solution at: &lt;a title="http://www.aocampo.com/Downloads/DataVirtSample.zip" href="http://www.aocampo.com/Downloads/DataVirtSample.zip"&gt;http://www.aocampo.com/Downloads/DataVirtSample.zip&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The solution contains:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;A sample WPF application project (&lt;em&gt;DataVirtClient&lt;/em&gt;) that uses the Xceed DataGrid for WPF. You will need to set the Xceed DataGrid for WPF Professional Edition license key in the &lt;em&gt;App.xaml.cs&lt;/em&gt; file to run the application. &lt;/li&gt;    &lt;li&gt;A sample ASP .Net web service project (&lt;em&gt;DataVirtSvc&lt;/em&gt;) that is called by the WPF application. The web service serves as the data source for the data being virtualized in the WPF application. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Notes&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;I tried to make the sample as simple as possible. Hopefully, the simplified implementation will make understanding the technique easier. Having said this, note that this ‘bare bones’ sample is for demonstration purposes only and it is up to you to take the essence of the technique and refine it to fit your problem. &lt;/li&gt;    &lt;li&gt;The main methods that the web service must provide are:      &lt;ul&gt;       &lt;li&gt;A method to provide the item count in a dataset &lt;/li&gt;        &lt;li&gt;A method to provide a ‘page’ of a dataset &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Main ingredients of data virtualization with the Xceed DataGrid for WPF:      &lt;ul&gt;       &lt;li&gt;Use a &lt;em&gt;DataGridVirtualizingCollectionView &lt;/em&gt;as the control’s &lt;em&gt;ItemsSource&lt;/em&gt; &lt;/li&gt;        &lt;li&gt;Handle the &lt;em&gt;QueryItemCount&lt;/em&gt; and &lt;em&gt;QueryItems&lt;/em&gt; events of the &lt;em&gt;DataGridVirtualizingCollectionView&lt;/em&gt;           &lt;ul&gt;           &lt;li&gt;Call the appropriate web service methods in these event handlers &lt;/li&gt;            &lt;li&gt;In the &lt;em&gt;QueryItems&lt;/em&gt; event, call the web method asynchronously &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;I mentioned using ASP .Net session state for my solution in my previous post. This sample does not do that as the web service uses a static data set. My guess is that you will have to implement some sort of persistence (like ASP .Net session state) or notification mechanism in your app if you will be working with non-static data. In the case of my previous post, I used ASP .Net session state to persist the dataset (of RSS feed items) that is currently bound to the datagrid to keep the dataset virtually static on the server (i.e., the server will work on the persisted dataset in session state instead of live data in the database that is prone to change every few minutes --- I know that this solution generally does not scale well but it is acceptable in my case). &lt;/li&gt;    &lt;li&gt;The solution was built with version 3.1 of the Xceed DataGrid for WPF (version 3.2 was released recently). &lt;/li&gt; &lt;/ul&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:3a9410be-215e-4760-ab6a-cac7bf9a1f54" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Data+Virtualization" rel="tag"&gt;Data Virtualization&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Xceed+DataGrid+for+WPF" rel="tag"&gt;Xceed DataGrid for WPF&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Downloads" rel="tag"&gt;Downloads&lt;/a&gt;&lt;/div&gt;&lt;img src="http://aocampo.com/Blog/aggbug/211.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2009/07/01/sample-code-data-virtualization-using-a-web-service-with-xceed.aspx</guid>
            <pubDate>Wed, 01 Jul 2009 06:09:20 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/211.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2009/07/01/sample-code-data-virtualization-using-a-web-service-with-xceed.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/211.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Data Virtualization with Xceed DataGrid for WPF</title>
            <category>Software Development</category>
            <link>http://aocampo.com/Blog/archive/2009/03/30/data-virtualization-with-xceed-datagrid-for-wpf.aspx</link>
            <description>&lt;p&gt;I wrote about my adventures in &lt;a href="http://aocampo.com/Blog/archive/2009/03/01/converting-a-web-application-busternews.com-to-a-wpf-desktop-application.aspx" target="_blank"&gt;converting a Web application (BusterNews.com) to WPF in a previous post&lt;/a&gt;. In that article, I briefly mentioned that I wanted to set the new application apart from its web counterpart by presenting feed items in a contiguous list instead of the ‘paged’ approach of a web application. The main challenge in accomplishing this goal was that the application’s data source is a web service (no data is cached on the client), and so providing this feature was not as straightforward as using a built-in WPF feature. Fortunately, it was as straightforward as utilizing the &lt;a href="http://xceed.com/Grid_WPF_Intro.html" target="_blank"&gt;Xceed DataGrid&lt;/a&gt;’s data virtualization capabilities (available on the Pro version).&lt;/p&gt;  &lt;p&gt;Before I continue, let me point out that Xceed provides a far more detailed sample project (which was the basis of my solution) in their documentation. My focus in this post is the technique I used for integrating the web service as a data source of the data grid; the feature set I use is only a small subset of the data virtualization capabilities of the datagrid control.&lt;/p&gt;  &lt;p&gt;Back to the problem: I wanted to present feed items such that a user can navigate anywhere in the list just as they would in a desktop application like Outlook. The problem was that certain feeds may have thousands of items and bringing this data back from a web service may be very costly in terms of bandwidth and perform poorly from the user experience perspective. The image below shows a sample of this case --- news feeds like MSNBC may contain thousands of items over a period of two weeks because it updates many times a day. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image_4.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="BusterNews Reader" border="0" alt="BusterNews Reader" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image_thumb_1.png" width="484" height="405" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;My solution consisted of two main parts: &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Setting-up the datagrid for virtualization &lt;/li&gt;    &lt;li&gt;Setting up web services to serve the data that the datagrid needs &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Setting up the DataGrid&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Setting up the DataGrid requires configuring it with a &lt;em&gt;DataGridVirtualizingCollectionView&lt;/em&gt; data source and setting event handlers for the specified data source.&lt;/p&gt;  &lt;p&gt;The following XAML code block shows part of the declaration that includes binding to the datasource:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre class="code"&gt;&lt;a href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image19.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="" border="0" alt="" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image19_thumb.png" width="605" height="119" /&gt;&lt;/a&gt; &lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;The &lt;em&gt;ItemsSource&lt;/em&gt; property is bound to &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;a &lt;em&gt;ReaderFeedItems&lt;/em&gt; dependency property of the page which is a &lt;em&gt;DataGridVirtualizingCollectionView&lt;/em&gt; type. The property is set up as follows:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image_12.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="" border="0" alt="" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image_thumb_4.png" width="798" height="177" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;The code above shows the following:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;em&gt;ReaderFeedItems&lt;/em&gt; is set to a &lt;em&gt;DataGridVirtualizingCollectionView&lt;/em&gt; with a page size (&lt;em&gt;m_feedItemsPageSize&lt;/em&gt;) and a maximum realized item count (&lt;em&gt;m_feedItemsMaxRealizedItemCount&lt;/em&gt;). This sets up the datagrid with a special collection view that knows how to perform data virtualization. The collection view is configured with settings for managing the paging of data items and memory. &lt;/li&gt;

  &lt;li&gt;Handlers are set for the different data virtualization events: 
    &lt;ul&gt;
      &lt;li&gt;The &lt;em&gt;QueryItemCount&lt;/em&gt; event occurs when the datagrid needs to know how many items are in the data source. &lt;/li&gt;

      &lt;li&gt;The &lt;em&gt;QueryItems&lt;/em&gt; event occurs when the datagrid needs a page of data. &lt;/li&gt;

      &lt;li&gt;The &lt;em&gt;AbortQueryItems&lt;/em&gt; event occurs when the request for a page of data is cancelled. &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The event handlers look something like this:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image_15.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="" border="0" alt="" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image_thumb_6.png" width="787" height="325" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The code above shows the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;em&gt;ReaderFeedItems_QueryItemCount&lt;/em&gt; calls a web service to get the feed items count for the currently selected feed source. &lt;/li&gt;

  &lt;li&gt;&lt;em&gt;ReaderFeedItems_QueryItems&lt;/em&gt; makes an asynchronous call to a web service for the set of data requested by the data grid. When the asynchronous call is successfully completed, the data returned is passed back to the datagrid. This is shown in the following event handler code: 

    &lt;br /&gt;

    &lt;br /&gt;&lt;a href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image_5.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="" border="0" alt="" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/DataVirtualizationwithXceedDataGridforWP_148D6/image_thumb.png" width="655" height="323" /&gt;&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The solution is generally as simple as that. &lt;/p&gt;

&lt;p&gt;One significant implementation note I would like to make is that I had to cache the datasets (using ASP .Net session state) on the server side to keep return values for queries consistent throughout a user session. Without this, data virtualization will fail once the data changes as the application currently has no mechanism for getting notified when new feed items for the current dataset have come in.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:03e56be1-eeaf-460d-a90c-bdfd8685b5e0" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Data+Virtualization" rel="tag"&gt;Data Virtualization&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Xceed+DataGrid+for+WPF" rel="tag"&gt;Xceed DataGrid for WPF&lt;/a&gt;&lt;/div&gt;&lt;img src="http://aocampo.com/Blog/aggbug/201.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2009/03/30/data-virtualization-with-xceed-datagrid-for-wpf.aspx</guid>
            <pubDate>Mon, 30 Mar 2009 04:45:27 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/201.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2009/03/30/data-virtualization-with-xceed-datagrid-for-wpf.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/201.aspx</wfw:commentRss>
        </item>
        <item>
            <title>WPF Value Converter via MarkupExtension</title>
            <category>Software Development</category>
            <link>http://aocampo.com/Blog/archive/2009/03/19/wpf-value-converter-via-markupextension.aspx</link>
            <description>&lt;p&gt;Dr. WPF had a great &lt;a href="http://www.drwpf.com/blog/Home/tabid/36/EntryID/48/Default.aspx" target="_blank"&gt;post&lt;/a&gt; about deriving a value converter from MarkupExtension to avoid having to declare the converter as a static resource before being able to access it. This is a very convenient way of providing a value converter with less steps. I extended his technique and created a generic abstract class that can be used to derive value converters from to avoid the repetitive code that I would need to remember per his approach.&lt;/p&gt;  &lt;p&gt;Here’s the result:&lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 520px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;    &lt;span style="color: #008000"&gt;// Base class&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;abstract&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ConverterMarkupExtension&amp;lt;T&amp;gt; : MarkupExtension, IValueConverter
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;    where T : &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt;()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; T m_converter = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; ProvideValue(IServiceProvider serviceProvider)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (m_converter == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;                m_converter = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; T();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; m_converter;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        #region IValueConverter Members
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;abstract&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; Convert(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;, Type targetType, 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; parameter, System.Globalization.CultureInfo culture);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;abstract&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; ConvertBack(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;, Type targetType, 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; parameter, System.Globalization.CultureInfo culture);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        #endregion
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;    &lt;span style="color: #008000"&gt;//Sample derived class&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; BytesToKBValueConverter : ConverterMarkupExtension
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; Convert(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;, Type targetType, 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; parameter, System.Globalization.CultureInfo culture)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;value&lt;/span&gt; != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt; &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; &lt;span style="color: #0000ff"&gt;double&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;                &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; bytes = System.Convert.ToDouble(&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; bytes / 1024.0d;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; ConvertBack(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;, 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            Type targetType, &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; parameter, 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            System.Globalization.CultureInfo culture)
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;            &lt;span style="color: #0000ff"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; NotSupportedException();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 11px"&gt;    }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;…and a sample markup to use the value converter:&lt;/p&gt;

&lt;pre&gt;&lt;a href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/WPFValueConverterviaMarkupExtension_FF39/image_6.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/WPFValueConverterviaMarkupExtension_FF39/image_thumb_2.png" width="673" height="31" /&gt;&lt;/a&gt; &lt;/pre&gt;

&lt;p&gt;This approach also made it easier to convert my existing value converters.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:33fd3cb3-c430-4b67-8899-9fbf501c6f7c" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;, &lt;a href="http://technorati.com/tags/IValueConverter" rel="tag"&gt;IValueConverter&lt;/a&gt;, &lt;a href="http://technorati.com/tags/MarkupExtension" rel="tag"&gt;MarkupExtension&lt;/a&gt;&lt;/div&gt;

&lt;pre class="code"&gt; &lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;img src="http://aocampo.com/Blog/aggbug/200.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2009/03/19/wpf-value-converter-via-markupextension.aspx</guid>
            <pubDate>Fri, 20 Mar 2009 03:42:39 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/200.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2009/03/19/wpf-value-converter-via-markupextension.aspx#feedback</comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/200.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Converting a Web Application (BusterNews.com) to a WPF Desktop Application</title>
            <category>Software Development</category>
            <link>http://aocampo.com/Blog/archive/2009/03/01/converting-a-web-application-busternews.com-to-a-wpf-desktop-application.aspx</link>
            <description>&lt;p&gt;I wrote &lt;a target="_blank" href="http://www.busternews.com"&gt;BusterNews.com&lt;/a&gt; in 2004 as a personal exercise in ASP .Net. The application has served me very well through the years as my online RSS reader. I recently found myself writing a counterpart of the reader in WPF. &lt;/p&gt;
&lt;p&gt;I have been contemplating to convert &lt;a target="_blank" href="http://www.busternews.com"&gt;BusterNews.com&lt;/a&gt; into a rich Internet application (RIA) since the first beta of Silverlight came out a long time ago. I have never been able to do it due to the limits of time and technology. However, for most week nights the past week and a half, the stars aligned for me to come up with a decent WPF version of the reader part of the application. Although it is not an RIA, I should be able to easily convert this version into a XAML Browser Application (XBAP), then, eventually, into a Silverlight application. &lt;/p&gt;
&lt;p&gt;I think being able to come up with this application in a relatively short period of time was due mostly to the following:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;The application to be converted was already stable – a good data model is already in place and ready for consumption. &lt;/li&gt;
    &lt;li&gt;I am now more familiar with the tools and technologies to be used to meet my objective. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Technical Implementation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;On the back-end, the SQL Server database is unchanged. However, I wrote ASP.Net web services to provide the inter-op services between the WPF application and the database. The Entity Framework and LINQ provided means to rapidly implement these. My current version is noticeably slower (but acceptable) in performance than the original because it does not (yet) use stored procedures.&lt;/p&gt;
&lt;p&gt;On the front-end, WPF provides the technology to come up with a rich, interactive application. Although I haven’t taken advantage of many of WPF’s UI features such as animation, effects, etc., the GUI that I came up with is significantly more useful than the web version (e.g., using the FlowDocumentReader control, I provide instant features for searching content and changing a document’s view). WPF’s powerful data binding features also provide the services I need to easily present the same data in many places, in different ways. In addition to this, a crucial component of the application is the Xceed DataGrid for WPF which provides data virtualization (a topic for a separate blog entry) --- while &lt;a target="_blank" href="http://www.busternews.com"&gt;BusterNews.com&lt;/a&gt; provides a view of the data in pages, the WPF version, despite having a web service as a data source, is able to provide virtually a full view of the data without much negative impact on performance. &lt;/p&gt;
&lt;p&gt;The application is deployed as published ClickOnce application so I get the benefits of being able to install the application from the web, as well as the online update features of ClickOnce applications to easily upgrade to new versions (this was very useful in testing, to update my test installations as I found bugs). Deploying the application is as easy as using the ‘Publish’ option from Visual Studio 2008 and specifying the publishing information.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Challenges&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I encountered some challenges in coming up with this application, probably mostly due to lack of planning; I have had this project at the back of my mind for a long time and then it ‘just happened.’ Some of the real technical challenges I encountered were:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Designing the web services – I initially planned to keep the web services stateless. However, I ended up using session state as it plays a major role in my implementation of data virtualization. I struggled with making this decision for a relatively long time but I think I made the right one.&lt;/li&gt;
    &lt;li&gt;Converting HTML to XAML – RSS feeds for blogs are usually formatted in HTML. In a web application, it does not take much effort to display HTML. In a WPF application, however, presenting HTML is not as easy. Although there is a web browser control that could host the HTML, the control is just a wrapper to the IE browser control and does not play well with WPF in terms of presentation, just like Windows Forms controls. The solution was to find a way to convert HTML to XAML. This took a lot of effort. I found two top contenders for my implementation – &lt;a target="_blank" href="http://windowsclient.net/downloads/folders/controlgallery/entry2313.aspx"&gt;XAML/HTML Converter&lt;/a&gt; and &lt;a target="_blank" href="http://code.msdn.microsoft.com/SgmlReader"&gt;SgmlReader&lt;/a&gt;. I ended up using XAML/HTML Converter, modifying the code slightly to fit my requirements, including support for images; this is still a work in progress but I can live with the current version that I have.&lt;/li&gt;
    &lt;li&gt;Presenting data – As I mentioned above, &lt;a target="_blank" href="http://www.busternews.com"&gt;BusterNews.com&lt;/a&gt; presents a view of data in pages, as is common in web applications. I wanted to overcome this limitation in my WPF application. The challenge was that the data source for the application is a web service and I wanted the application to perform as if the application had a direct connection to the data and show the data in a contiguous list rather than in pages. The Xceed DataGrid for WPF (Professional Edition) solves this problem for me by providing data virtualization (I will talk about this in a separate blog entry). The result is a responsive application that requests just the right amount of data from the web service (if it is not already in memory) as is needed by the current view of the user.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;The result&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Following are screen shots of &lt;a target="_blank" href="http://www.busternews.com"&gt;BusterNews.com&lt;/a&gt; and its WPF counterpart, BusterNews Reader, respectively.&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/ConvertingaWebApplicationtoWPFDesktopApp_1061C/image_2.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="BusterNews.com" border="0" alt="BusterNews.com" width="404" height="268" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/ConvertingaWebApplicationtoWPFDesktopApp_1061C/image_thumb.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/ConvertingaWebApplicationtoWPFDesktopApp_1061C/image_4.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="BusterNews Reader" border="0" alt="BusterNews Reader" width="404" height="304" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/ConvertingaWebApplicationtoWPFDesktopApp_1061C/image_thumb_1.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This has been an exciting exercise for me, to make the old new again. My next step is to convert the WPF application into an XBAP to make it more web-friendly; hopefully within the next few weeks.&lt;/p&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://www.busternews.com"&gt;BusterNews.com&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://windowsclient.net/downloads/folders/controlgallery/entry2313.aspx"&gt;XAML/HTML Converter&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://code.msdn.microsoft.com/SgmlReader"&gt;SgmlReader&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://xceed.com/Grid_WPF_Intro.html"&gt;Xceed DataGrid for WPF&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:dc0da66e-89dc-47b0-a7c8-ddf55e9e1182" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/WPF"&gt;WPF&lt;/a&gt;&lt;/div&gt;&lt;img src="http://aocampo.com/Blog/aggbug/193.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2009/03/01/converting-a-web-application-busternews.com-to-a-wpf-desktop-application.aspx</guid>
            <pubDate>Mon, 02 Mar 2009 02:32:01 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/193.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2009/03/01/converting-a-web-application-busternews.com-to-a-wpf-desktop-application.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/193.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Xceed DataGrid for WPF Version 3.1 Released</title>
            <category>Software</category>
            <category>Software Development</category>
            <link>http://aocampo.com/Blog/archive/2009/02/01/xceed-datagrid-for-wpf-version-3.1-released.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/XceedDataGridforWPFVersion3.1Released_A3FD/image_2.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Xceed Live Explorer" border="0" alt="Xceed Live Explorer" align="right" src="http://aocampo.com/Blog/images/aocampo_com/Blog/WindowsLiveWriter/XceedDataGridforWPFVersion3.1Released_A3FD/image_thumb.png" width="320" height="295" /&gt;&lt;/a&gt; &lt;a href="http://xceed.com" target="_blank"&gt;Xceed&lt;/a&gt; recently released version 3.1 of their excellent DataGrid control for WPF. I have been using their free Express Edition (v2.0) for the past year and my applications have benefited a lot from the powerful built-in features that it provides. This control has saved me a lot of time in coding, as well as designing the presentation of data. &lt;/p&gt;  &lt;p&gt;The Express edition includes other free and useful controls like a DatePicker and NumericTextBox. Xceed provides great free support resources too --- browsing their community forums has answered a lot of my questions ranging from the simple, ‘Getting Started’, type, to the more involved and task/design-specific ones.&lt;/p&gt;  &lt;p&gt;Links:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://xceed.com/" target="_blank"&gt;Xceed Web Site&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://xceed.com/pages/TopMenu/Downloads/Trials.aspx?Lang=EN-CA" target="_blank"&gt;Xceed Downloads&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:b0839e81-582f-4b54-8c6a-7a6aedcc8977" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Xceed+DataGrid+for+WPF" rel="tag"&gt;Xceed DataGrid for WPF&lt;/a&gt;, &lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;&lt;/div&gt;&lt;img src="http://aocampo.com/Blog/aggbug/184.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2009/02/01/xceed-datagrid-for-wpf-version-3.1-released.aspx</guid>
            <pubDate>Sun, 01 Feb 2009 16:44:37 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/184.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2009/02/01/xceed-datagrid-for-wpf-version-3.1-released.aspx#feedback</comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/184.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Office Automation: Fix for Application Crashing After &amp;lsquo;CodeModule.AddFromString&amp;rsquo;</title>
            <category>Software Development</category>
            <link>http://aocampo.com/Blog/archive/2009/01/30/office-automation-fix-for-application-crashing-after-lsquocodemodule.addfromstringrsquo.aspx</link>
            <description>&lt;p&gt;I had a problem with Microsoft Office Word 2003 crashing after calling &lt;em&gt;CodeModule.AddFromString&lt;/em&gt; to add custom code to the document. The code was creating command buttons on-the-fly, then adding the corresponding event handler code for each button’s &lt;em&gt;Click&lt;/em&gt; event.&lt;/p&gt;  &lt;p&gt;I was able to successfully get &lt;em&gt;AddFromString&lt;/em&gt; to run in a simple version of the project. However, after adding the real, more complex logic, Word started to crash. Browsing user forums was of little help in finding a reliable solution --- a lot of experts discouraged the technique as it alters the state of the code at runtime. That makes sense, but in my case I really needed to create the command buttons at runtime as the workflow of the document requires it. &lt;/p&gt;  &lt;p&gt;In my testing, I found that the crash does not happen when I display &lt;em&gt;MsgBox&lt;/em&gt;’s. It seems to me that the crash was happening as a matter of a timing issue. After hours of trial-and-error and analysis, the solution that I found was related to this theory: call &lt;em&gt;AddFromString&lt;/em&gt; last (or as late as possible) and only once. My workflow was such that I needed to create multiple command buttons and event handlers for each one that was created. The logic in my code executed such that for each iteration of the button creation, an event handler was created via &lt;em&gt;AddFromString&lt;/em&gt;. My code was calling &lt;em&gt;AddFromString&lt;/em&gt; multiple times. I also had another part of the application where &lt;em&gt;AddFromString&lt;/em&gt; is called only once but other automation functions were performed on the document afterwards; this also crashed the application.&lt;/p&gt;  &lt;p&gt;Forming all of the necessary code into a string and writing it via &lt;em&gt;AddFromString&lt;/em&gt; (only once) at the end of a routine fixes the problem. &lt;/p&gt;  &lt;p&gt;Note: I mentioned above that the solution is to call &lt;em&gt;AddFromString&lt;/em&gt; last or as late as possible. I have one case that works where &lt;em&gt;AddFromString&lt;/em&gt; is second to the last piece of code that executes --- the last piece deletes parts of the document that the code for &lt;em&gt;AddFromString&lt;/em&gt; is dependent on.&lt;/p&gt;  &lt;p&gt;Link: &lt;a href="http://support.microsoft.com/kb/246299" target="_blank"&gt;How to add a button to a Word document and assign its Click event at run-time&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:81346cff-e8d7-4641-bbed-48ec19fda3b2" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Office+Automation" rel="tag"&gt;Office Automation&lt;/a&gt;, &lt;a href="http://technorati.com/tags/AddFromString" rel="tag"&gt;AddFromString&lt;/a&gt;, &lt;a href="http://technorati.com/tags/Word+VBA" rel="tag"&gt;Word VBA&lt;/a&gt;&lt;/div&gt;&lt;img src="http://aocampo.com/Blog/aggbug/178.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Alan Ocampo</dc:creator>
            <guid>http://aocampo.com/Blog/archive/2009/01/30/office-automation-fix-for-application-crashing-after-lsquocodemodule.addfromstringrsquo.aspx</guid>
            <pubDate>Sat, 31 Jan 2009 04:02:05 GMT</pubDate>
            <wfw:comment>http://aocampo.com/Blog/comments/178.aspx</wfw:comment>
            <comments>http://aocampo.com/Blog/archive/2009/01/30/office-automation-fix-for-application-crashing-after-lsquocodemodule.addfromstringrsquo.aspx#feedback</comments>
            <wfw:commentRss>http://aocampo.com/Blog/comments/commentRss/178.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>