﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Philip Beadle's Blog</title>
    <description>This blog is more general than my Blog at http://www.dotnetnuke.com/Community/Blogs/tabid/825/Default.aspx.  You'll find mostly technical tips and tricks and things i am doing in the MS user group community.</description>
    <link>http://philipbeadle.net/Home/tabid/252/BlogId/3/Default.aspx</link>
    <language>en-US</language>
    <webMaster>philip.beadle@live.com.au</webMaster>
    <pubDate>Fri, 12 Mar 2010 04:28:45 GMT</pubDate>
    <lastBuildDate>Fri, 12 Mar 2010 04:28:45 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.5.1.19887</generator>
    <item>
      <title>How to build a fully Blendable and Testable Silverlight, RIA Services DNN Module – Part 4 – RIA Services</title>
      <description>&lt;p&gt;In Part 3 we did the basics of setting up MVVM for our module.  Now lets look at getting some data into our application using RIA Services.  It’s fairly straight forward to set up RIA Services as the Visual Studio templates do all the lifting for you.  Follow these steps to add RIA Services to your solution:&lt;/p&gt;  &lt;p&gt;Note: I have change the table name for the Announcements table to Announcement so that the generated class names and collections make more sense.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;We already added the project we are going to use so go to AnnouncementServices and Add a New Item and choose Linq to Sql Classes, and call it AnnouncementDataClasses.dbml.     &lt;br /&gt;You can use Entity Framework here if you prefer.      &lt;br /&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_2.png"&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="/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_thumb.png" width="244" height="151" /&gt;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Now open the Server Explorer and open your DotNetNuke database and drag the Announcement table onto the design surface.  You should see this;     &lt;br /&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_4.png"&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="/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_thumb_1.png" width="231" height="244" /&gt;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Now build your solution.  You need to build it so that when we add the domain service the wizard can find the entity classes.&lt;/li&gt;    &lt;li&gt;Now add another new item called Domain Service Class and call it AnnouncementDomainService.cs     &lt;br /&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_6.png"&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="/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_thumb_2.png" width="244" height="151" /&gt;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Check all the boxes so that you get the meta data class, Client Access and the CRUD methods     &lt;br /&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_8.png"&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="/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_thumb_3.png" width="231" height="244" /&gt;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Add a reference from your web application MySilverlightApplication.Web to the AnnouncementServices project and build your application.&lt;/li&gt;    &lt;li&gt;Your solution explorer should look like this now     &lt;br /&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_10.png"&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="/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_thumb_4.png" width="189" height="244" /&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;You can see the “magic” file generated by the RIA Services link to your Silverlight Application.  Investigate this file and take note of the classes in there.  This is how we will communicate with the server from our client side application.  You can see that we have a partial class called Announcement which is an entity class.&lt;/p&gt;  &lt;p&gt;If you’re wondering how RIA Communicates with the server when havent made any Service References have a look at line 348:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; AnnouncementDomainContext() : &lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;this&lt;/span&gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; HttpDomainClient(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;"DataService.axd/AnnouncementServices-AnnouncementDomainService/"&lt;/span&gt;, System.UriKind.Relative)))&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;RIA uses a httpHandler to manage the communication so you need to make sure that you update the web.config of your site.  Look at the app.config file in the AnnouncementServices project and copy the handler.  If you are using IIS 7+ you will need to also add the handler to the system.webserver section.  So add the following 2 items:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;This goes in system.web handlers section&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;path&lt;/span&gt;&lt;span class="kwrd"&gt;="DataService.axd"&lt;/span&gt; &lt;span class="attr"&gt;verb&lt;/span&gt;&lt;span class="kwrd"&gt;="GET,POST"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Web.Ria.DataServiceFactory, System.Web.Ria, Version=2.0.0.0, &lt;br /&gt;Culture=neutral, PublicKeyToken=31bf3856ad364e35"&lt;/span&gt; &lt;span class="attr"&gt;validate&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt;&lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;and this goes in system.webserver handlers section&lt;span class="kwrd"&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="kwrd"&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="DataService"&lt;/span&gt; &lt;span class="attr"&gt;verb&lt;/span&gt;&lt;span class="kwrd"&gt;="GET,POST"&lt;/span&gt; &lt;span class="attr"&gt;path&lt;/span&gt;&lt;span class="kwrd"&gt;="DataService.axd"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Web.Ria.DataServiceFactory, System.Web.Ria, 
    &lt;br /&gt;Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&lt;/span&gt;&lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The next step is to update our model so that it has a method to retrieve Announcement entities from the database.  &lt;/p&gt;

&lt;p&gt;Modify the IAnnouncementModel interface like so:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MySilverlightApplication.Model&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IAnnouncementsModel&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;void&lt;/span&gt; GetAnnouncementList(Action&lt;IEnumerable&lt;Announcement&gt;&gt; action);&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Tip: If you are using ReSharper you can include the generated file in the project to help it find the generated classes.&lt;/p&gt;

&lt;p&gt;Now we need to implement the interface’s new method:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MySilverlightApplication.Model&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AnnouncementsModel : IAnnouncementsModel&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; GetAnnouncementList(Action&lt;IEnumerable&lt;Announcement&gt;&gt; action)&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            var context = &lt;span class="kwrd"&gt;new&lt;/span&gt; AnnouncementDomainContext();&lt;/pre&gt;

  &lt;pre&gt;            var qry = context.GetAnnouncementsQuery().Where(a =&gt; a.ModuleID == 376);&lt;/pre&gt;

  &lt;pre class="alt"&gt;            context.Load(qry, op =&gt; action(op.Entities), &lt;span class="kwrd"&gt;null&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Now let’s write our first test.  We are going to write a test that tests to make sure we have two Announcement entities loaded into the ViewModel when create a new ViewModel.  We are going to do some TDD here so this test will fail until we write the minimum amount of production code to make it pass.&lt;/p&gt;

&lt;p&gt;Open up your MSTest project and change the UnitTest.cs file name to ViewModelTests.cs&lt;/p&gt;

&lt;p&gt;Now modify it so it looks like this:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MySilverlightApplication.MSTest&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    [TestClass]&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ViewModelTests : SilverlightTest&lt;/pre&gt;

  &lt;pre class="alt"&gt;    {&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;readonly&lt;/span&gt; MainPageViewModel _viewModel = &lt;span class="kwrd"&gt;new&lt;/span&gt; MainPageViewModel(&lt;span class="kwrd"&gt;new&lt;/span&gt; MockAnnouncementsModel());&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;        [TestMethod]&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ViewModelDataLoadsCorrectly()&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            Assert.AreEqual(2, _viewModel);&lt;/pre&gt;

  &lt;pre&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Here you can see why we used two constructors on the MainPageViewModel class and why we instantiate it with an interface, so we can pass in our own MockAnnouncementsModel for testing.&lt;/p&gt;

&lt;p&gt;Run the test and it will fail because it doesnt make much sense yet.  What we need is something on the VM to hold a list of Announcement entities so lets add an ObservableCollection.  Add the following code to the ViewModel&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; ObservableCollection&lt;Announcement&gt; _announcements;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; ObservableCollection&lt;Announcement&gt; Announcements&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;    get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _announcements; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    set&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        _announcements = &lt;span class="kwrd"&gt;value&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="rem"&gt;//OnPropertyChanged("Announcements");&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Don’t worry about the OnPropertyChanged bit yet, we’ll get to that soon.&lt;/p&gt;

&lt;p&gt;Ok so now we have somewhere to store our result lets populate it.  Add the following method:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; LoadModel()&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    _announcementsList.GetAnnouncementList(op =&gt;&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        Announcements = op.AsObservableCollection();&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (LoadComplete != &lt;span class="kwrd"&gt;null&lt;/span&gt;) LoadComplete(&lt;span class="kwrd"&gt;this&lt;/span&gt;, &lt;span class="kwrd"&gt;null&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;    });&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I’m using an extension method here called AsObservableCollection because I’m always turning IEnumerable in AsObservable.  To do this add a new Silverlight class library project to your solution and call it Common.  Then add a class called Extensions and modify it as below:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Common&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Extensions&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; ObservableCollection&lt;T&gt; AsObservableCollection&lt;T&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt; System.Collections.Generic.IEnumerable&lt;T&gt; col)&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            var newcol = &lt;span class="kwrd"&gt;new&lt;/span&gt; ObservableCollection&lt;T&gt;();&lt;/pre&gt;

  &lt;pre&gt;            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var item &lt;span class="kwrd"&gt;in&lt;/span&gt; col)&lt;/pre&gt;

  &lt;pre class="alt"&gt;            {&lt;/pre&gt;

  &lt;pre&gt;                newcol.Add(item);&lt;/pre&gt;

  &lt;pre class="alt"&gt;            }&lt;/pre&gt;

  &lt;pre&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; newcol;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        }&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Now add a reference to it from the MySilverlightApplication project and build your solution.&lt;/p&gt;

&lt;p&gt;Next we’ll modify the Mock data model class so it returns 2 Announcement entities.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MySilverlightApplication.MSTest&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;class&lt;/span&gt; MockAnnouncementsModel : IAnnouncementsModel&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; GetAnnouncementList(Action&lt;IEnumerable&lt;Announcement&gt;&gt; action)&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            action(MockData());&lt;/pre&gt;

  &lt;pre&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; IEnumerable&lt;Announcement&gt; MockData()&lt;/pre&gt;

  &lt;pre class="alt"&gt;        {&lt;/pre&gt;

  &lt;pre&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt;[]&lt;/pre&gt;

  &lt;pre class="alt"&gt;                  {&lt;/pre&gt;

  &lt;pre&gt;                    &lt;span class="kwrd"&gt;new&lt;/span&gt; Announcement()&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    {&lt;/pre&gt;

  &lt;pre&gt;                      Title = &lt;span class="str"&gt;"Test Title 1"&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre class="alt"&gt;                      CreatedDate = &lt;span class="kwrd"&gt;new&lt;/span&gt; DateTime(2009, 9, 9)&lt;/pre&gt;

  &lt;pre&gt;                    },&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    &lt;span class="kwrd"&gt;new&lt;/span&gt; Announcement()&lt;/pre&gt;

  &lt;pre&gt;                    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;                      Title = &lt;span class="str"&gt;"Test Title 2"&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;                      CreatedDate = &lt;span class="kwrd"&gt;new&lt;/span&gt; DateTime(2009, 9, 10)&lt;/pre&gt;

  &lt;pre class="alt"&gt;                    }&lt;/pre&gt;

  &lt;pre&gt;                  };&lt;/pre&gt;

  &lt;pre class="alt"&gt;        }&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Lastly modify the test so it calls the Load method and does it’s assert against the count of the collection like so:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;[TestMethod]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ViewModelDataLoadsCorrectly()&lt;/pre&gt;

  &lt;pre class="alt"&gt;{&lt;/pre&gt;

  &lt;pre&gt;    _viewModel.LoadModel();&lt;/pre&gt;

  &lt;pre class="alt"&gt;    Assert.AreEqual(2, _viewModel.Announcements.Count());&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Run the test and you should get a nice green tick:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_12.png"&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="/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_thumb_5.png" width="239" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Righto, good news the test passes so now we can go to our DNN web site and have a look at the module.  Make sure you have some announcements in the database first :)&lt;/p&gt;

&lt;p&gt;Make sure you attach the debugger to the process and put a break point in the LoadModel so that you can see the results coming back properly.  Now if you’re wondering why the results don’t show up in the site that’s because we need to let the UI know that we have some results.  To do that we Implement INotifyPropertyChanged.  Since we will use this all over the place we’ll add it into the Common project.&lt;/p&gt;

&lt;p&gt;Add a new class called ViewModelBase and modify it to look like:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Common&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ViewModelBase : INotifyPropertyChanged&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; PropertyChangedEventHandler PropertyChanged;&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnPropertyChanged(&lt;span class="kwrd"&gt;params&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;[] propertyNames)&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;null&lt;/span&gt; == PropertyChanged)&lt;/pre&gt;

  &lt;pre&gt;                &lt;span class="kwrd"&gt;return&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var each &lt;span class="kwrd"&gt;in&lt;/span&gt; propertyNames)&lt;/pre&gt;

  &lt;pre&gt;            {&lt;/pre&gt;

  &lt;pre class="alt"&gt;                PropertyChanged(&lt;span class="kwrd"&gt;this&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; PropertyChangedEventArgs(each));&lt;/pre&gt;

  &lt;pre&gt;            }&lt;/pre&gt;

  &lt;pre class="alt"&gt;        }&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now go the MainPageViewModel class and make it inherit the new ViewModelBase class and then uncomment the OnPropertyChanged line.  Now rebuild and check your module.  You should get this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_14.png"&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="/Portals/6/Blog/Files/3/621/WLW-HowtobuildafullyBlendableandTestableSilv_AEBE-image_thumb_6.png" width="244" height="187" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Ok that’s it for Part 4, we looked at how to write a test for the View Model and how to hook up RIA services and get data into our UI.  Remember the code is available at CodePlex &lt;a title="http://dnnsilverlightria.codeplex.com/" href="http://dnnsilverlightria.codeplex.com/"&gt;http://dnnsilverlightria.codeplex.com/&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/621/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-4-ndash-RIA-Services.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/621/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-4-ndash-RIA-Services.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/621/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-4-ndash-RIA-Services.aspx</guid>
      <pubDate>Fri, 25 Sep 2009 03:50:52 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=621</trackback:ping>
    </item>
    <item>
      <title>Source code for Blendable and Testable Silverlight, RIA Services DNN Module on CodePlex</title>
      <description>&lt;p&gt;I have been adding the source code for this blog series on my Downloads page at each step and I also loaded it up to CodePlex. &lt;a title="http://dnnsilverlightria.codeplex.com/" href="http://dnnsilverlightria.codeplex.com/"&gt;http://dnnsilverlightria.codeplex.com/&lt;/a&gt;.  If you would like to contribute please contact me.&lt;/p&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/620/Source-code-for-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-on-CodePlex.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/620/Source-code-for-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-on-CodePlex.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/620/Source-code-for-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-on-CodePlex.aspx</guid>
      <pubDate>Thu, 24 Sep 2009 20:45:24 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=620</trackback:ping>
    </item>
    <item>
      <title>How to build a fully Blendable and Testable Silverlight, RIA Services DNN Module – Part 3 - MVVM</title>
      <description>&lt;p&gt;So we’re all set to write some code now.  I will be using the MVVM pattern to separate the concerns and to make the logic testable.  MVVM stands for Model – View – View Model, the View is the MainPage.xaml, the View Model will be MainPage.vm.cs and the Model will be our list of announcements.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Add a new Silverlight class to the MySilverlightApplication project and call it MainPage.vm.cs, this will be the code file for the View Model.     &lt;br /&gt;I have a registry entry that assocaites my MainPage.vm.cs file with my MainPage.xaml.cs file the same way the MainPage.xaml.cs file is associated.  It looks like this for my 64 bit machine      &lt;br /&gt;      &lt;br /&gt;Windows Registry Editor Version 5.00 &lt;/li&gt;    &lt;p&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}\RelatedFiles\.xaml]     &lt;br /&gt;".xaml.cs"=dword:00000039      &lt;br /&gt;".cs"=dword:00000002      &lt;br /&gt;".vm.cs"=dword:00000039      &lt;br /&gt;".design.cs"=dword:00000039&lt;/p&gt;    &lt;li&gt;Change the name of the class to MainPageViewModel,&lt;/li&gt;    &lt;li&gt;Now we need to set up our Model which will use an interface so we can easily swap out the model into our View Model for testing.&lt;/li&gt;    &lt;ol&gt;     &lt;li&gt;Add a folder called Model,&lt;/li&gt;      &lt;li&gt;Add a class called IAnnouncementsModel, it’s actually an interface so you’ll need to change it from a class to interface.&lt;/li&gt;      &lt;li&gt;Your interface should look like this:       &lt;br /&gt;&lt;/li&gt;      &lt;div class="csharpcode"&gt;       &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MySilverlightApplication.Model&lt;/pre&gt;

      &lt;pre&gt;{&lt;/pre&gt;

      &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;interface&lt;/span&gt; IAnnouncementsModel&lt;/pre&gt;

      &lt;pre&gt;    {&lt;/pre&gt;

      &lt;pre class="alt"&gt;    }&lt;/pre&gt;

      &lt;pre&gt;}&lt;/pre&gt;
    &lt;/div&gt;
    &lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

    &lt;li&gt;Now we need a concrete implementation of this so add another class called AnnouncementsModel that implements this interface.&lt;/li&gt;

    &lt;li&gt;Your class should look like this:
      &lt;br /&gt;&lt;/li&gt;

    &lt;div class="csharpcode"&gt;
      &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MySilverlightApplication.Model&lt;/pre&gt;

      &lt;pre&gt;{&lt;/pre&gt;

      &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AnnouncementsModel : IAnnouncementsModel&lt;/pre&gt;

      &lt;pre&gt;    {&lt;/pre&gt;

      &lt;pre class="alt"&gt; &lt;/pre&gt;

      &lt;pre&gt;    }&lt;/pre&gt;
    &lt;/div&gt;
    &lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/ol&gt;
&lt;/ol&gt;

&lt;p&gt;That's the model setup for now, we’ll add methods to it a bit later, let’s wire up the View Model with our model now.  We will provide two constructors for the View Model.  One will be used when we test it and the other will be used when it runs normally.  Edit your View Model class to look like the following:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MySilverlightApplication&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MainPageViewModel&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;readonly&lt;/span&gt; IAnnouncementsModel _announcementsList;&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; EventHandler LoadComplete;&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; MainPageViewModel()&lt;/pre&gt;

  &lt;pre class="alt"&gt;            : &lt;span class="kwrd"&gt;this&lt;/span&gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; AnnouncementsModel())&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        }&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; MainPageViewModel(IAnnouncementsModel announcementsList)&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            _announcementsList = announcementsList;&lt;/pre&gt;

  &lt;pre&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;The last thing we need to do is to tell the View to set its DataContext to the ViewModel at runtime.  We only want this to occur outside of Blend so the following test will load our VM at runtime and will use the SampleData in Blend.&lt;/p&gt;

&lt;p&gt;Change the code behind file for MainPage.xaml.cs to look like the following:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MySilverlightApplication&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; MainPage : UserControl&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; MainPage()&lt;/pre&gt;

  &lt;pre&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;            InitializeComponent();&lt;/pre&gt;

  &lt;pre&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (!System.ComponentModel.DesignerProperties.IsInDesignTool)&lt;/pre&gt;

  &lt;pre class="alt"&gt;            {&lt;/pre&gt;

  &lt;pre&gt;                DataContext = &lt;span class="kwrd"&gt;new&lt;/span&gt; MainPageViewModel();&lt;/pre&gt;

  &lt;pre class="alt"&gt;            }&lt;/pre&gt;

  &lt;pre&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;So that’s our MVVM pattern set up.  In Part 4 we will look at creating the RIA Service for the Announcements and doing some testing of our ViewModel.&lt;/p&gt;

&lt;p&gt;The files for these parts are available on the Downloads page of this site.&lt;/p&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/619/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-3-MVVM.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/619/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-3-MVVM.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/619/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-3-MVVM.aspx</guid>
      <pubDate>Thu, 24 Sep 2009 07:23:50 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=619</trackback:ping>
    </item>
    <item>
      <title>How to build a fully Blendable and Testable Silverlight, RIA Services DNN Module – Part 2 - Blendability</title>
      <description>&lt;p&gt;Now that you have your modules registered place it on a page.  You should see your module with an empty Silverlight control inside it.  Now switch to the settigns for the module and hit the checkbox to change it to load the SLTest Silverlight control.  This will execute the one test that is in teh file at this point and it will fail giving you the following result.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/618/WLW-HowtobuildafullyBlendableandTestableSilv_DEEC-image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/6/Blog/Files/3/618/WLW-HowtobuildafullyBlendableandTestableSilv_DEEC-image_thumb.png" width="244" height="107" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As you can see the testing results panel shows up as it is conducting the tests and gives you the result.  This is an excellent way to create integration tests for your module and it makes it very easy to ensure that as you code you are keeping your quality high and not introducing any new issues.  You can try out debugging at this point as well.  In the SLTest project add a break point to the Initialize event and then do Attach to process and select the Silverlight process like so.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/618/WLW-HowtobuildafullyBlendableandTestableSilv_DEEC-image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/6/Blog/Files/3/618/WLW-HowtobuildafullyBlendableandTestableSilv_DEEC-image_thumb_1.png" width="244" height="169" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Let’s get into designing our Announcements list.  The idea is that this module will replace the existing Announcements module.  So we will re-implement the same functionality starting off with listing the items in a nice list.  To do this we will use Expression Blend and use the cool new Sample Data feature.  Follow these steps:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Right click the MainPage.xaml file and select Open In Expression Blend, &lt;/li&gt;    &lt;li&gt;Add a ListBox control to the page and set its margins to 8 all around, &lt;/li&gt;    &lt;li&gt;Select the Data Tab, &lt;/li&gt;    &lt;li&gt;Click “Define new Sample Data”, &lt;/li&gt;    &lt;li&gt;Uncheck the “Enable smale data when application is running”, we don’t want sample data then we will have our own data from the database.  Unchecking this makes Silverlight ignore the sample data at run time which is exactly what we want to happen. &lt;/li&gt;    &lt;li&gt;Select Ok. &lt;/li&gt;    &lt;li&gt;You will now have the Sample data showing in the Data Tab.  Change the name from Collection to Announcements, this will be the name for our real data collection as well that we will use RIA to retrieve later. &lt;/li&gt;    &lt;li&gt;Now change the property names to match the fields in the Announcements table in your DNN database.  You may need to install the standard DNN Announcements module to see this table.  You only need to add the properties for the fields you want to show in the list here.      &lt;ol&gt;       &lt;li&gt;Make sure you set the property names exactly as they are in the database.  &lt;/li&gt;        &lt;li&gt;You can change the sample data by clicking the symbol to the right of the property name.  Set the Title property to be String – Name, set the CreatedDate to String – Date etc. &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Now select the Announcements Collection and drag it onto the ListBox.  Its hould now look like the following      &lt;br /&gt;&lt;a href="http://philipbeadle.net/Portals/6/Blog/Files/3/618/WLW-HowtobuildafullyBlendableandTestableSilv_DEEC-image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="/Portals/6/Blog/Files/3/618/WLW-HowtobuildafullyBlendableandTestableSilv_DEEC-image_thumb_2.png" width="244" height="191" /&gt;&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;When you drag on the collection Blend adds a DataContext to the LayoutRoot grid.  Remove this text in the xaml      &lt;br /&gt;      &lt;p&gt;d:DataContext="{Binding Source={StaticResource SampleDataSource}}"        &lt;br /&gt;        &lt;br /&gt;and move it into the UserControl declaration as shown below:         &lt;br /&gt;&lt;/p&gt;      &lt;div class="csharpcode"&gt;       &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;UserControl&lt;/span&gt; &lt;span class="attr"&gt;x:Class&lt;/span&gt;&lt;span class="kwrd"&gt;="MySilverlightApplication.MainPage"&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;    &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt; &lt;/pre&gt;

      &lt;pre class="alt"&gt;    &lt;span class="attr"&gt;xmlns:x&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;    &lt;span class="attr"&gt;xmlns:d&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/expression/blend/2008"&lt;/span&gt; &lt;/pre&gt;

      &lt;pre class="alt"&gt;    &lt;span class="attr"&gt;xmlns:mc&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.openxmlformats.org/markup-compatibility/2006"&lt;/span&gt; &lt;/pre&gt;

      &lt;pre&gt;    &lt;strong&gt;&lt;span class="attr"&gt;d:DataContext&lt;/span&gt;&lt;span class="kwrd"&gt;="{Binding Source={StaticResource SampleDataSource}}"&lt;/span&gt;&lt;/strong&gt;&lt;/pre&gt;

      &lt;pre class="alt"&gt;    &lt;span class="attr"&gt;mc:Ignorable&lt;/span&gt;&lt;span class="kwrd"&gt;="d"&lt;/span&gt; &lt;span class="attr"&gt;d:DesignWidth&lt;/span&gt;&lt;span class="kwrd"&gt;="640"&lt;/span&gt; &lt;span class="attr"&gt;d:DesignHeight&lt;/span&gt;&lt;span class="kwrd"&gt;="480"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
    &lt;/div&gt;
    &lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ok you are now set up to design the ListBox as you see fit.  Have some fun with Blend, you can easily edit how the ListBox looks by right clicking it and selecting “Edit Additional Templates” –&gt; “Edit Generated Items” –&gt; “Edit Current”.  You are now in template editing mode and can edit the items template to your hearts content.&lt;/p&gt;

&lt;p&gt;Om so now you can see a nicely formatted list of items in Blend.  Try going back to Visual Studio rebuilding your application and checking it out in runtime mode.  You’ll see there are no items in the list :)  This is what is called Blendability, your designer can now design away and create a beautiful interface with nice sample data that doesnt interfere with the application when it is running in production.&lt;/p&gt;

&lt;p&gt;That’s it for Part 2.  In Part 3 we will look at using the MVVM pattern to make our application easily testable and we’ll get some real data into our list.&lt;/p&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/618/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-2-Blendability.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/618/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-2-Blendability.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/618/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-2-Blendability.aspx</guid>
      <pubDate>Thu, 24 Sep 2009 06:52:12 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=618</trackback:ping>
    </item>
    <item>
      <title>How to build a fully Blendable and Testable Silverlight, RIA Services DNN Module – Part 1 Setting up</title>
      <description>&lt;p&gt;This series of posts will show you a bunch of things I have learnt about building integrated Silverlight – DotNetNuke modules with RIA Services&lt;/p&gt;  &lt;p&gt;Projects to add:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Add a new Silverlight Project.  Call it MySilverlightApplication. &lt;/li&gt;    &lt;li&gt;Select to host it in a new Web Application called MySilverlightApplication.Web and check the Enable RIA Services link. &lt;/li&gt;    &lt;li&gt;Add a new Silverlight Unit Testing project and call it MySilverlightApplication.SLtest. &lt;/li&gt;    &lt;li&gt;Add a new Unit Test Project and call it MySilverlightApplication.MSTest &lt;/li&gt;    &lt;li&gt;Create a Solution Folder called Modules and move these four projects into it. &lt;/li&gt;    &lt;li&gt;Create another solution folder and call it Services. &lt;/li&gt;    &lt;li&gt;Add a new .Net class library (not a Silverlight one) and call it AuthenticationServices &lt;/li&gt;    &lt;li&gt;Our module is going to interact with the Announcements table so add another .Net class library and call it AnnouncementServices &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Ok we now have all the projects we need to build a fully testable and Blendable Silverlight Application for DotNetNuke.  Let’s do a little cleaning up and get everything ready for easy designing, testing and developing.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Delete the .aspx and .html files from the MySilverlightApplication.Web project. &lt;/li&gt;    &lt;li&gt;Click on the web.config file and set the build action to None.  The DNN site already has a web.config. &lt;/li&gt;    &lt;li&gt;Click on the Silverlight.js file and set the Copy To Output Directory to Copy If Newer. &lt;/li&gt;    &lt;li&gt;Open double click teh Properties node in teh Solution Explorer and add the MySilverlightApplication.SLtest project as a linked Silverlight Application. &lt;/li&gt;    &lt;li&gt;Add a new Folder to the MySilverlightApplication.SLtest called Dependencies and add the Microsoft.Silverlight.Testing.dll and Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll files to it.  &lt;/li&gt;    &lt;li&gt;Now add references to those two files so that your Silverlight Test project builds. &lt;/li&gt;    &lt;li&gt;Open the MSTest project and remove the references to System and System.Core, we need to replace these with the Silverlight specific versions. &lt;/li&gt;    &lt;li&gt;Add a reference to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v3.0\system.dll.  You will also need references to System.Core, System.Net and System.Windows which are all in the same folder. &lt;/li&gt;    &lt;li&gt;Also add a reference to the same two dlls as in step 5 and to C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Silverlight\System.Windows.Ria.dll &lt;/li&gt;    &lt;li&gt;Now to both the SLTest and MSTest projects ad a reference to the Silverlight Application. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Everything should be building ok now so let’s make some changes to the .csproj files so that the correct files are deployed to our Development DotNetNuke site for easy debugging and automated integration testing.&lt;/p&gt;  &lt;p&gt;For debugging we need the .xap, .dll and .pdb files to be deployed onto the Development DNN instance, to do this I modify the .csproj files to do a copy after the build is finished.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Right click the MySilverlightApplication and select Unload Project. &lt;/li&gt;    &lt;li&gt;Right click it again and select Edit which will open the MSBuild file for the project. &lt;/li&gt;    &lt;li&gt;Towards the bottom of the file you will see some commented out code.  Paste the following immediately after that code. &lt;/li&gt; &lt;/ol&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;="AfterBuild"&lt;/span&gt; &lt;span class="attr"&gt;DependsOnTargets&lt;/span&gt;&lt;span class="kwrd"&gt;="DeployModule"&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;          &lt;span class="attr"&gt;Condition&lt;/span&gt;&lt;span class="kwrd"&gt;=" '$(IsDesktopBuild)'!='false' "&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;DNNDirectory&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      D:\DotNetNuke\DotNetNuke_Community_05.01.01_Install&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;DNNDirectory&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;ModuleFolder&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;      MySilverlightApplication&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;ModuleFolder&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;="DeployModule"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildProjectDirectory)\$(OutputPath)\*.xap"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Output&lt;/span&gt; &lt;span class="attr"&gt;TaskParameter&lt;/span&gt;&lt;span class="kwrd"&gt;="Include"&lt;/span&gt; &lt;span class="attr"&gt;ItemName&lt;/span&gt;&lt;span class="kwrd"&gt;="ModuleXap"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildProjectDirectory)\$(OutputPath)\*.dll"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Output&lt;/span&gt; &lt;span class="attr"&gt;TaskParameter&lt;/span&gt;&lt;span class="kwrd"&gt;="Include"&lt;/span&gt; &lt;span class="attr"&gt;ItemName&lt;/span&gt;&lt;span class="kwrd"&gt;="ModuleAssemblies"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildProjectDirectory)\$(OutputPath)\*.pdb"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Output&lt;/span&gt; &lt;span class="attr"&gt;TaskParameter&lt;/span&gt;&lt;span class="kwrd"&gt;="Include"&lt;/span&gt; &lt;span class="attr"&gt;ItemName&lt;/span&gt;&lt;span class="kwrd"&gt;="ModuleDebug"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;="@(ModuleAssemblies);@(ModuleDebug);@(ModuleXap)"&lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;          &lt;span class="attr"&gt;DestinationFolder&lt;/span&gt;&lt;span class="kwrd"&gt;="$(DNNDirectory)\DesktopModules\$(ModuleFolder)\ClientBin"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Make sure you update the DNNDirectory and the ModuleFolder to your required values.  Do exactly the same for the SLTest project as well.  The condition in the Target is there so that this step is ignored when the solution is built with Team Foundation Server Build.&lt;/p&gt;

&lt;p&gt;We need to do a very similar modification to the Web project as well.  There is a slight difference here in that this change also packages up the appropriate files and creates the .zip file for install and source and a total package as well so every time you build you have a deployable .zip file ready to install on any other DotNetNuke site.  You will need to install the MSBuild Community Tasks from to use the Zip target.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Install the MSBuild Community Tasks &lt;/li&gt;

  &lt;li&gt;Paste the following Immediately after the commented out code as before. &lt;/li&gt;
&lt;/ol&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Import&lt;/span&gt; &lt;span class="attr"&gt;Project&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildExtensionsPath)\&lt;/pre&gt;

  &lt;pre&gt;       MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;="AfterBuild"&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="attr"&gt;DependsOnTargets&lt;/span&gt;&lt;span class="kwrd"&gt;="DeployModule"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Major&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;01&lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;Major&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Minor&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;00&lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;Minor&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Build&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;00&lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;Build&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;ModuleFolder&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;      CHEAPLiveCosts&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;ModuleFolder&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;DNNDirectory&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      C:\Sandboxes\CHEAP\CHEAP_Development&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;DNNDirectory&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;PackageDirectory&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;      C:\DotNetNuke\Packages&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;PackageDirectory&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;PropertyGroup&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;  &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;="DeployModule"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildProjectDirectory)\$(OutputPath)\*.dll"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Output&lt;/span&gt; &lt;span class="attr"&gt;TaskParameter&lt;/span&gt;&lt;span class="kwrd"&gt;="Include"&lt;/span&gt; &lt;span class="attr"&gt;ItemName&lt;/span&gt;&lt;span class="kwrd"&gt;="ModuleAssemblies"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildProjectDirectory)\$(OutputPath)\*.pdb"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;      &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Output&lt;/span&gt; &lt;span class="attr"&gt;TaskParameter&lt;/span&gt;&lt;span class="kwrd"&gt;="Include"&lt;/span&gt; &lt;span class="attr"&gt;ItemName&lt;/span&gt;&lt;span class="kwrd"&gt;="ModuleDebug"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;="@(Content)"&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;          &lt;span class="attr"&gt;DestinationFiles&lt;/span&gt;="@(&lt;span class="attr"&gt;Content&lt;/span&gt; &lt;span class="attr"&gt;-&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt; '$(DNNDirectory)\&lt;/pre&gt;

  &lt;pre class="alt"&gt;                         DesktopModules\$(ModuleFolder)\%(Identity)')" &lt;/pre&gt;

  &lt;pre&gt;          SkipUnchangedFiles="true" &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;="@(ModuleAssemblies);@(ModuleDebug)"&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;          &lt;span class="attr"&gt;DestinationFolder&lt;/span&gt;&lt;span class="kwrd"&gt;="$(DNNDirectory)\bin"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;="@(Content)"&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;          &lt;span class="attr"&gt;DestinationFiles&lt;/span&gt;="@(&lt;span class="attr"&gt;Content&lt;/span&gt; &lt;span class="attr"&gt;-&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt; '$(MSBuildProjectDirectory)\Package\%(Identity)')" SkipUnchangedFiles="true" &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;="@(ModuleAssemblies);"&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;          &lt;span class="attr"&gt;DestinationFolder&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildProjectDirectory)\Package\bin"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt; &lt;span class="attr"&gt;Include&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildProjectDirectory)\Package\**\*.*"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Output&lt;/span&gt; &lt;span class="attr"&gt;TaskParameter&lt;/span&gt;&lt;span class="kwrd"&gt;="Include"&lt;/span&gt; &lt;span class="attr"&gt;ItemName&lt;/span&gt;&lt;span class="kwrd"&gt;="OutputContent"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;CreateItem&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;Zip&lt;/span&gt; &lt;span class="attr"&gt;Files&lt;/span&gt;&lt;span class="kwrd"&gt;="@(OutputContent)"&lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;         &lt;span class="attr"&gt;WorkingDirectory&lt;/span&gt;&lt;span class="kwrd"&gt;="$(MSBuildProjectDirectory)\Package"&lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;         &lt;span class="attr"&gt;ZipFileName&lt;/span&gt;&lt;span class="kwrd"&gt;="$(ProjectName)_$(Major).$(Minor).$(Build)_Install.zip"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;For formatting I have changed the DNNDirectory, PackageDirectory and ModuleFolder nodes.  Remove the line breaks otherwise you will get an error that says you have illegal characters in the path.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Now when you build your solution you should get a new folder under DesktopModules that has a ClientBin folder and the js file.  The ClientBin folder should have the .xap file and any associated dlls and pdb files.&lt;/p&gt;

&lt;p&gt;Next we need to add the Usercontrol files to the .Web project so we can register and host the Silverlight application inside DotNetNuke.  Lately i have been using the same Web project to host both the Silverlight Application and the SLTest xap, I add a setting so that i can switch from real to integration test easily.  &lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Add a new User Control to the Web project and call it View.ascx. &lt;/li&gt;

  &lt;li&gt;Add another User Control and call it Settings. &lt;/li&gt;

  &lt;li&gt;Add a reference to the DotNetNuke.dll file. &lt;/li&gt;

  &lt;li&gt;Open up the View.ascx file and paste the following in: 
    &lt;br /&gt;

    &lt;div class="csharpcode"&gt;
      &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/javascript"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;    &lt;span class="kwrd"&gt;function&lt;/span&gt; onSilverlightError(sender, args) {&lt;/pre&gt;

      &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;var&lt;/span&gt; appSource = &lt;span class="str"&gt;""&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (sender != &lt;span class="kwrd"&gt;null&lt;/span&gt; &amp;&amp; sender != 0) {&lt;/pre&gt;

      &lt;pre class="alt"&gt;            appSource = sender.getHost().Source;&lt;/pre&gt;

      &lt;pre&gt;        } &lt;span class="kwrd"&gt;var&lt;/span&gt; errorType = args.ErrorType;&lt;/pre&gt;

      &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;var&lt;/span&gt; iErrorCode = args.ErrorCode;&lt;/pre&gt;

      &lt;pre&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (errorType == &lt;span class="str"&gt;"ImageError"&lt;/span&gt; || errorType == &lt;span class="str"&gt;"MediaError"&lt;/span&gt;) {&lt;/pre&gt;

      &lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre&gt;        }&lt;/pre&gt;

      &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;var&lt;/span&gt; errMsg = &lt;span class="str"&gt;"Unhandled Error in Silverlight Application "&lt;/span&gt; + &lt;/pre&gt;

      &lt;pre&gt;        appSource + &lt;span class="str"&gt;"\n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre class="alt"&gt;        errMsg += &lt;span class="str"&gt;"Code: "&lt;/span&gt; + iErrorCode + &lt;span class="str"&gt;"    \n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre&gt;        errMsg += &lt;span class="str"&gt;"Category: "&lt;/span&gt; + errorType + &lt;span class="str"&gt;"       \n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre class="alt"&gt;        errMsg += &lt;span class="str"&gt;"Message: "&lt;/span&gt; + args.ErrorMessage + &lt;span class="str"&gt;"     \n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (errorType == &lt;span class="str"&gt;"ParserError"&lt;/span&gt;) {&lt;/pre&gt;

      &lt;pre class="alt"&gt;            errMsg += &lt;span class="str"&gt;"File: "&lt;/span&gt; + args.xamlFile + &lt;span class="str"&gt;"     \n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre&gt;            errMsg += &lt;span class="str"&gt;"Line: "&lt;/span&gt; + args.lineNumber + &lt;span class="str"&gt;"     \n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre class="alt"&gt;            errMsg += &lt;span class="str"&gt;"Position: "&lt;/span&gt; + args.charPosition + &lt;span class="str"&gt;"     \n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre&gt;        }&lt;/pre&gt;

      &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;else&lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (errorType == &lt;span class="str"&gt;"RuntimeError"&lt;/span&gt;) {&lt;/pre&gt;

      &lt;pre&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (args.lineNumber != 0) {&lt;/pre&gt;

      &lt;pre class="alt"&gt;                errMsg += &lt;span class="str"&gt;"Line: "&lt;/span&gt; + args.lineNumber + &lt;span class="str"&gt;"     \n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre&gt;                errMsg += &lt;span class="str"&gt;"Position: "&lt;/span&gt; + args.charPosition + &lt;span class="str"&gt;"     \n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre class="alt"&gt;            }&lt;/pre&gt;

      &lt;pre&gt;            errMsg += &lt;span class="str"&gt;"MethodName: "&lt;/span&gt; + args.methodName + &lt;span class="str"&gt;"     \n"&lt;/span&gt;;&lt;/pre&gt;

      &lt;pre class="alt"&gt;        }&lt;/pre&gt;

      &lt;pre&gt;        &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Error(errMsg);&lt;/pre&gt;

      &lt;pre class="alt"&gt;    }&lt;/pre&gt;

      &lt;pre&gt;&lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre class="alt"&gt; &lt;/pre&gt;

      &lt;pre&gt;&lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="silverlightControlHost"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="position: relative; &lt;/pre&gt;

      &lt;pre class="alt"&gt;    width: 100%; height: 500px;&lt;/pre&gt;

      &lt;pre&gt;    vertical-align: top; z-index: 50;"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;object&lt;/span&gt; &lt;span class="attr"&gt;data&lt;/span&gt;&lt;span class="kwrd"&gt;="data:application/x-silverlight-2,"&lt;/span&gt; &lt;/pre&gt;

      &lt;pre&gt;    &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="application/x-silverlight-2"&lt;/span&gt;&lt;/pre&gt;

      &lt;pre class="alt"&gt;        &lt;span class="attr"&gt;width&lt;/span&gt;&lt;span class="kwrd"&gt;="100%"&lt;/span&gt; &lt;span class="attr"&gt;height&lt;/span&gt;&lt;span class="kwrd"&gt;="100%"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;        &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;param&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="source"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;='&lt;%=SilverlightApplication %&gt;'&lt;/span&gt;&lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;param&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="onError"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="onSilverlightError"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;        &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;param&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="background"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="Transparent"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;         &lt;/pre&gt;

      &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;param&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="windowless"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt; &lt;/pre&gt;

      &lt;pre&gt;        &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;param&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="minRuntimeVersion"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="3.0.40624.0"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;param&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="autoUpgrade"&lt;/span&gt; &lt;span class="attr"&gt;value&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;        &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40624.0"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="text-decoration: none"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre class="alt"&gt;            &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;img&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;="http://go.microsoft.com/fwlink/?LinkId=108181"&lt;/span&gt; &lt;span class="attr"&gt;alt&lt;/span&gt;&lt;span class="kwrd"&gt;="Get Microsoft Silverlight"&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;                &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="border-style: none"&lt;/span&gt; &lt;span class="kwrd"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;    &lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;object&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&lt;&lt;/span&gt;&lt;span class="html"&gt;iframe&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="_sl_historyFrame"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="visibility: &lt;/pre&gt;

      &lt;pre&gt;        hidden; height: 0px; width: 0px;&lt;/pre&gt;

      &lt;pre class="alt"&gt;        border: 0px"&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;iframe&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;

      &lt;pre&gt;&lt;span class="kwrd"&gt;&lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;
    &lt;/div&gt;
    &lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;

  &lt;li&gt;Open up the code behind file and modify it to look like this. 
    &lt;br /&gt;

    &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; View : PortalModuleBase
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; SilverlightApplication { get; set; }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; SilverlightInitParams { get; set; }
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
    {
        &lt;span class="kwrd"&gt;bool&lt;/span&gt; isChecked;
        var xapFile = &lt;span class="str"&gt;"MySilverlightApplication.xap"&lt;/span&gt;;
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;bool&lt;/span&gt;.TryParse(Settings[&lt;span class="str"&gt;"IsTest"&lt;/span&gt;].ToString(), &lt;span class="kwrd"&gt;out&lt;/span&gt; isChecked))
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (isChecked)
                xapFile = &lt;span class="str"&gt;"MySilverlightApplication.SLTest.xap"&lt;/span&gt;;
        }
        &lt;span class="rem"&gt;// Register Silverlight.js file            &lt;/span&gt;
        Page.ClientScript.RegisterClientScriptInclude(&lt;span class="kwrd"&gt;this&lt;/span&gt;.GetType(), 
            &lt;span class="str"&gt;"SilverlightJS"&lt;/span&gt;, (String.Format(&lt;span class="str"&gt;@"{0}{1}"&lt;/span&gt;, 
            TemplateSourceDirectory, &lt;span class="str"&gt;"/Silverlight.js"&lt;/span&gt;)));
        &lt;span class="rem"&gt;// Set the path to the .xap file   &lt;/span&gt;
        SilverlightApplication = String.Format(&lt;span class="str"&gt;"{0}/ClientBin/{1}"&lt;/span&gt;, 
            TemplateSourceDirectory, xapFile);
        &lt;span class="rem"&gt;// Pass the Initialization Parameters to the Silverlight Control            &lt;/span&gt;
        SilverlightInitParams = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"Test={0}"&lt;/span&gt;, &lt;span class="str"&gt;"Some init stuff"&lt;/span&gt;);
    }
}&lt;/pre&gt;
    &lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/li&gt;

  &lt;li&gt;In the settings file add a check box and save its value as a setting and call the setting “IsTest”. &lt;/li&gt;

  &lt;li&gt;Now build you solution. &lt;/li&gt;

  &lt;li&gt;You are now ready to register your module with DotNetNuke so go ahead and do that. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s it for Part 1.  You are now set up ready to start developing, designing and testing your application.  &lt;/p&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/617/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-1-Setting-up.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/617/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-1-Setting-up.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/617/How-to-build-a-fully-Blendable-and-Testable-Silverlight-RIA-Services-DNN-Module-ndash-Part-1-Setting-up.aspx</guid>
      <pubDate>Thu, 24 Sep 2009 03:21:17 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=617</trackback:ping>
    </item>
    <item>
      <title>Just got back from Tech Ed Aus 2009</title>
      <description>&lt;p&gt;Last week I attended Tech Ed Australia for the 5th time in a row and what a great time was had by all.  I did plenty of networking (really means beer drinking with delegates) and attended a bunch of cool sessions and I even delivered a lunch time session on my fave topics, DotNetNuke, Silverlight and RIA Services.  &lt;/p&gt;  &lt;p&gt;I went to a bunch of Silverlight/UX sessions by &lt;a href="http://blogs.msdn.com/shanemo/" target="_blank"&gt;Shane Morris&lt;/a&gt; (Microsoft) which were excellent and really brought home to me how much room for improvement there is the application/site design UX space.  So Im really going to be pushing some of his recommendations and finding ways to convince clients that there are better ways they just have to trust me :)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.webjak.net" target="_blank"&gt;Jordan&lt;/a&gt; and Mahesh who both work with me at &lt;a href="http://www.readify.net" target="_blank"&gt;Readify&lt;/a&gt; gave an excellent session  on architectural considerations when building Silverlight applications and Jordan also had a going deeper with Silverlight session that I can’t wait to get my hands on the code from.&lt;/p&gt;  &lt;p&gt;I also went to see &lt;a href="http://www.soulsolutions.com.au/" target="_blank"&gt;John and Bronwen from Soul Solutions&lt;/a&gt; do a session on spatial data and the Bing Maps Control.  That was an eye opener.  I had heard about spatial in SQL 2008 but had never used it, now I’m going to use it on my current project to display some mined data.&lt;/p&gt;  &lt;p&gt;Thanx everyone who I met and caught up with it was a great time.&lt;/p&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/616/Just-got-back-from-Tech-Ed-Aus-2009.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/616/Just-got-back-from-Tech-Ed-Aus-2009.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/616/Just-got-back-from-Tech-Ed-Aus-2009.aspx</guid>
      <pubDate>Tue, 15 Sep 2009 21:07:13 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=616</trackback:ping>
    </item>
    <item>
      <title>THG002 Integrating Silverlight with your DotNetNuke sites come see me at Tech Ed Aus.</title>
      <description>&lt;p&gt;THG002 Integrating Silverlight with your DotNetNuke sites&lt;/p&gt;  &lt;p&gt;Presenter: Philip Beadle&lt;/p&gt;  &lt;p&gt;Wed 9/9 | 12:45-13:15 | Green Interactive Theatre&lt;/p&gt;  &lt;p&gt;In this session you will see how Silverlight and RIA Services can be used to provide an awesome UX both in and out of the browser for your DotNetNuke sites. You'll see how you can build a Silverlight DNN module that lets users login either through the web site or directly through an out of browser Silverlight app and get a seamless experience.&lt;/p&gt;  &lt;p&gt;Come and say hi.  I'll be around all week, probbaly wearlng a Readify Shirt or I'll be the guy with the left arm completely tattooed, shouldnt be too hard to spot.&lt;/p&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/615/THG002-Integrating-Silverlight-with-your-DotNetNuke-sites-come-see-me-at-Tech-Ed-Aus.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/615/THG002-Integrating-Silverlight-with-your-DotNetNuke-sites-come-see-me-at-Tech-Ed-Aus.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/615/THG002-Integrating-Silverlight-with-your-DotNetNuke-sites-come-see-me-at-Tech-Ed-Aus.aspx</guid>
      <pubDate>Fri, 04 Sep 2009 09:25:43 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=615</trackback:ping>
    </item>
    <item>
      <title>I'm honoured to be made a Trustee of DotNetNuke</title>
      <description>&lt;p&gt;If you just read the latest DotNetNuke news letter you will have seen that the new teams have been announced.  I'm very honoured to have been promoted to Trustee!!  How cool.  I have been working with DNN since it started way back when and have had a great time.  Recently I have been a bit quiet while I got the hang of being a dad, but now I’m back into it and hope to bring a lot of value to the project by crafting up a testing strategy and automated tests.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.dotnetnuke.com/Portals/25/Blog/Files/18/2326/WLW-DotNetNukeCommunityTeamfor2009_D3B9-avatar-trustee_4.gif"&gt;&lt;img title="avatar-trustee" border="0" alt="avatar-trustee" src="http://www.dotnetnuke.com/Portals/25/Blog/Files/18/2326/WLW-DotNetNukeCommunityTeamfor2009_D3B9-avatar-trustee_thumb_1.gif" width="144" height="144" /&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/614/Im-honoured-to-be-made-a-Trustee-of-DotNetNuke.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/614/Im-honoured-to-be-made-a-Trustee-of-DotNetNuke.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/614/Im-honoured-to-be-made-a-Trustee-of-DotNetNuke.aspx</guid>
      <pubDate>Tue, 18 Aug 2009 23:17:07 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=614</trackback:ping>
    </item>
    <item>
      <title>SketchFlow Export to Word Feature</title>
      <description>&lt;p&gt;I just tried out the Export to Word feature and love it.  What a great idea, it easily turns your SketchFlow prototype into a Word doc with all of the screens and figure numbers for you.  This will definitely speed up my current project.&lt;/p&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/613/SketchFlow-Export-to-Word-Feature.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/613/SketchFlow-Export-to-Word-Feature.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/613/SketchFlow-Export-to-Word-Feature.aspx</guid>
      <pubDate>Fri, 14 Aug 2009 02:14:15 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=613</trackback:ping>
    </item>
    <item>
      <title>Writing a new Dummies Book, Silverlight for Dummies</title>
      <description>&lt;p&gt;I am writing a new Dummies book due out in a couple of montsh with my Readify colleague Mahesh.  Check out the blurb here &lt;a href="http://au.wiley.com/WileyCDA/WileyTitle/productCd-0470524650.html"&gt;&lt;u&gt;&lt;font color="#800080"&gt;http://au.wiley.com/WileyCDA/WileyTitle/productCd-0470524650.html&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href=http://www.philipbeadle.net/Home/tabid/252/EntryId/612/Writing-a-new-Dummies-Book-Silverlight-for-Dummies.aspx&gt;More...&lt;/a&gt;</description>
      <link>http://www.philipbeadle.net/Home/tabid/252/EntryId/612/Writing-a-new-Dummies-Book-Silverlight-for-Dummies.aspx</link>
      <comments>http://www.philipbeadle.net/Home/tabid/252/EntryId/612/Writing-a-new-Dummies-Book-Silverlight-for-Dummies.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.philipbeadle.net/Home/tabid/252/EntryId/612/Writing-a-new-Dummies-Book-Silverlight-for-Dummies.aspx</guid>
      <pubDate>Tue, 28 Jul 2009 00:47:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://philipbeadle.net/DesktopModules/Blog/Trackback.aspx?id=612</trackback:ping>
    </item>
  </channel>
</rss>