My Blog

Author:Philip BeadleCreated:Monday, September 15, 2008 10:40 AM
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.

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:

Note: I have change the table name for the Announcements table to Announcement so that the generated class names and collections make more sense.

  1. 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.
    You can use Entity Framework here if you prefer.
    image
  2. Now open the Server Explorer and open your DotNetNuke database and drag the Announcement table onto the design surface.  You should see this;
    image
  3. Now build your solution.  You need to build it so that when we add the domain service the wizard can find the entity classes.
  4. Now add another new item called Domain Service Class and call it AnnouncementDomainService.cs
    image
  5. Check all the boxes so that you get the meta data class, Client Access and the CRUD methods
    image
  6. Add a reference from your web application MySilverlightApplication.Web to the AnnouncementServices project and build your application.
  7. Your solution explorer should look like this now
    image

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.

If you’re wondering how RIA Communicates with the server when havent made any Service References have a look at line 348:

public AnnouncementDomainContext() : 
this(new HttpDomainClient(new Uri("DataService.axd/AnnouncementServices-AnnouncementDomainService/", System.UriKind.Relative)))
{
}

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:

This goes in system.web handlers section
<add path="DataService.axd" verb="GET,POST" type="System.Web.Ria.DataServiceFactory, System.Web.Ria, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false"/>

and this goes in system.webserver handlers section

<add name="DataService" verb="GET,POST" path="DataService.axd" type="System.Web.Ria.DataServiceFactory, System.Web.Ria,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
/>

The next step is to update our model so that it has a method to retrieve Announcement entities from the database. 

Modify the IAnnouncementModel interface like so:

namespace MySilverlightApplication.Model
{
public interface IAnnouncementsModel
    {
void GetAnnouncementList(Action<IEnumerable<Announcement>> action);
    }
}

Tip: If you are using ReSharper you can include the generated file in the project to help it find the generated classes.

Now we need to implement the interface’s new method:

namespace MySilverlightApplication.Model
{
public class AnnouncementsModel : IAnnouncementsModel
    {
public void GetAnnouncementList(Action<IEnumerable<Announcement>> action)
        {
            var context = new AnnouncementDomainContext();
            var qry = context.GetAnnouncementsQuery().Where(a => a.ModuleID == 376);
            context.Load(qry, op => action(op.Entities), null);
        }
    }
}

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.

Open up your MSTest project and change the UnitTest.cs file name to ViewModelTests.cs

Now modify it so it looks like this:

namespace MySilverlightApplication.MSTest
{
    [TestClass]
public class ViewModelTests : SilverlightTest
    {
readonly MainPageViewModel _viewModel = new MainPageViewModel(new MockAnnouncementsModel());
 
        [TestMethod]
public void ViewModelDataLoadsCorrectly()
        {
            Assert.AreEqual(2, _viewModel);
        }
    }
}

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.

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

private ObservableCollection<Announcement> _announcements;
public ObservableCollection<Announcement> Announcements
{
    get { return _announcements; }
    set
    {
        _announcements = value;
//OnPropertyChanged("Announcements");
    }
}

Don’t worry about the OnPropertyChanged bit yet, we’ll get to that soon.

Ok so now we have somewhere to store our result lets populate it.  Add the following method:

public void LoadModel()
{
    _announcementsList.GetAnnouncementList(op =>
    {
        Announcements = op.AsObservableCollection();
if (LoadComplete != null) LoadComplete(this, null);
    });
}

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:

namespace Common
{
public static class Extensions
    {
public static ObservableCollection<T> AsObservableCollection<T>(this System.Collections.Generic.IEnumerable<T> col)
        {
            var newcol = new ObservableCollection<T>();
 foreach (var item in col)
            {
                newcol.Add(item);
            }
 return newcol;
        }
    }
}

Now add a reference to it from the MySilverlightApplication project and build your solution.

Next we’ll modify the Mock data model class so it returns 2 Announcement entities.

namespace MySilverlightApplication.MSTest
{
class MockAnnouncementsModel : IAnnouncementsModel
    {
public void GetAnnouncementList(Action<IEnumerable<Announcement>> action)
        {
            action(MockData());
        }
 
public IEnumerable<Announcement> MockData()
        {
 return new[]
                  {
 new Announcement()
                    {
                      Title = "Test Title 1",
                      CreatedDate = new DateTime(2009, 9, 9)
                    },
 new Announcement()
                    {
                      Title = "Test Title 2",
                      CreatedDate = new DateTime(2009, 9, 10)
                    }
                  };
        }
    }
}

Lastly modify the test so it calls the Load method and does it’s assert against the count of the collection like so:

[TestMethod]
public void ViewModelDataLoadsCorrectly()
{
    _viewModel.LoadModel();
    Assert.AreEqual(2, _viewModel.Announcements.Count());
}

Run the test and you should get a nice green tick:

image

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 :)

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.

Add a new class called ViewModelBase and modify it to look like:

namespace Common
{
public class ViewModelBase : INotifyPropertyChanged
    {
public event PropertyChangedEventHandler PropertyChanged;
 
protected void OnPropertyChanged(params string[] propertyNames)
        {
 if (null == PropertyChanged)
 return;
 foreach (var each in propertyNames)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(each));
            }
        }
    }
}

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:

image

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 http://dnnsilverlightria.codeplex.com/

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. http://dnnsilverlightria.codeplex.com/.  If you would like to contribute please contact me.

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.

  1. 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.
    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

    Windows Registry Editor Version 5.00
  2. [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}\RelatedFiles\.xaml]
    ".xaml.cs"=dword:00000039
    ".cs"=dword:00000002
    ".vm.cs"=dword:00000039
    ".design.cs"=dword:00000039

  3. Change the name of the class to MainPageViewModel,
  4. 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.
    1. Add a folder called Model,
    2. Add a class called IAnnouncementsModel, it’s actually an interface so you’ll need to change it from a class to interface.
    3. Your interface should look like this:
    4. namespace MySilverlightApplication.Model
      {
      public interface IAnnouncementsModel
          {
          }
      }
    5. Now we need a concrete implementation of this so add another class called AnnouncementsModel that implements this interface.
    6. Your class should look like this:
    7. namespace MySilverlightApplication.Model
      {
      public class AnnouncementsModel : IAnnouncementsModel
          {
       
          }

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:

namespace MySilverlightApplication
{
public class MainPageViewModel
    {
private readonly IAnnouncementsModel _announcementsList;
public event EventHandler LoadComplete;
 
public MainPageViewModel()
            : this(new AnnouncementsModel())
        {
        }
 
public MainPageViewModel(IAnnouncementsModel announcementsList)
        {
            _announcementsList = announcementsList;
        }
    }
}

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.

Change the code behind file for MainPage.xaml.cs to look like the following:

namespace MySilverlightApplication
{
public partial class MainPage : UserControl
    {
public MainPage()
        {
            InitializeComponent();
 if (!System.ComponentModel.DesignerProperties.IsInDesignTool)
            {
                DataContext = new MainPageViewModel();
            }
        }
    }
}

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.

The files for these parts are available on the Downloads page of this site.

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.

image

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.

image

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:

  1. Right click the MainPage.xaml file and select Open In Expression Blend,
  2. Add a ListBox control to the page and set its margins to 8 all around,
  3. Select the Data Tab,
  4. Click “Define new Sample Data”,
  5. 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.
  6. Select Ok.
  7. 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.
  8. 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.
    1. Make sure you set the property names exactly as they are in the database. 
    2. 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.
  9. Now select the Announcements Collection and drag it onto the ListBox.  Its hould now look like the following
    image
  10. When you drag on the collection Blend adds a DataContext to the LayoutRoot grid.  Remove this text in the xaml

    d:DataContext="{Binding Source={StaticResource SampleDataSource}}"

    and move it into the UserControl declaration as shown below:

    <UserControl x:Class="MySilverlightApplication.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    d:DataContext="{Binding Source={StaticResource SampleDataSource}}"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">

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” –> “Edit Generated Items” –> “Edit Current”.  You are now in template editing mode and can edit the items template to your hearts content.

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.

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.

This series of posts will show you a bunch of things I have learnt about building integrated Silverlight – DotNetNuke modules with RIA Services

Projects to add:

  1. Add a new Silverlight Project.  Call it MySilverlightApplication.
  2. Select to host it in a new Web Application called MySilverlightApplication.Web and check the Enable RIA Services link.
  3. Add a new Silverlight Unit Testing project and call it MySilverlightApplication.SLtest.
  4. Add a new Unit Test Project and call it MySilverlightApplication.MSTest
  5. Create a Solution Folder called Modules and move these four projects into it.
  6. Create another solution folder and call it Services.
  7. Add a new .Net class library (not a Silverlight one) and call it AuthenticationServices
  8. Our module is going to interact with the Announcements table so add another .Net class library and call it AnnouncementServices

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.

  1. Delete the .aspx and .html files from the MySilverlightApplication.Web project.
  2. Click on the web.config file and set the build action to None.  The DNN site already has a web.config.
  3. Click on the Silverlight.js file and set the Copy To Output Directory to Copy If Newer.
  4. Open double click teh Properties node in teh Solution Explorer and add the MySilverlightApplication.SLtest project as a linked Silverlight Application.
  5. 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. 
  6. Now add references to those two files so that your Silverlight Test project builds.
  7. Open the MSTest project and remove the references to System and System.Core, we need to replace these with the Silverlight specific versions.
  8. 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.
  9. 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
  10. Now to both the SLTest and MSTest projects ad a reference to the Silverlight Application.

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.

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.

  1. Right click the MySilverlightApplication and select Unload Project.
  2. Right click it again and select Edit which will open the MSBuild file for the project.
  3. Towards the bottom of the file you will see some commented out code.  Paste the following immediately after that code.
<Target Name="AfterBuild" DependsOnTargets="DeployModule"
Condition=" '$(IsDesktopBuild)'!='false' ">
</Target>
<PropertyGroup>
 <DNNDirectory>
      D:\DotNetNuke\DotNetNuke_Community_05.01.01_Install
</DNNDirectory>
<ModuleFolder>
      MySilverlightApplication
</ModuleFolder>
</PropertyGroup>
<Target Name="DeployModule">
<CreateItem Include="$(MSBuildProjectDirectory)\$(OutputPath)\*.xap">
<Output TaskParameter="Include" ItemName="ModuleXap" />
</CreateItem>
<CreateItem Include="$(MSBuildProjectDirectory)\$(OutputPath)\*.dll">
<Output TaskParameter="Include" ItemName="ModuleAssemblies" />
</CreateItem>
<CreateItem Include="$(MSBuildProjectDirectory)\$(OutputPath)\*.pdb">
<Output TaskParameter="Include" ItemName="ModuleDebug" />
</CreateItem>
<Copy SourceFiles="@(ModuleAssemblies);@(ModuleDebug);@(ModuleXap)" 
DestinationFolder="$(DNNDirectory)\DesktopModules\$(ModuleFolder)\ClientBin" />
</Target>

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.

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.

  1. Install the MSBuild Community Tasks
  2. Paste the following Immediately after the commented out code as before.
<Import Project="$(MSBuildExtensionsPath)\
       MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
<Target Name="AfterBuild" 
DependsOnTargets="DeployModule">
</Target>
<PropertyGroup>
<Major>01</Major>
<Minor>00</Minor>
<Build>00</Build>
</PropertyGroup>
<PropertyGroup>
<ModuleFolder>
      CHEAPLiveCosts
</ModuleFolder>
<DNNDirectory>
      C:\Sandboxes\CHEAP\CHEAP_Development
</DNNDirectory>
<PackageDirectory>
      C:\DotNetNuke\Packages
</PackageDirectory>
</PropertyGroup>
<Target Name="DeployModule">
<CreateItem Include="$(MSBuildProjectDirectory)\$(OutputPath)\*.dll">
<Output TaskParameter="Include" ItemName="ModuleAssemblies" />
</CreateItem>
<CreateItem Include="$(MSBuildProjectDirectory)\$(OutputPath)\*.pdb">
<Output TaskParameter="Include" ItemName="ModuleDebug" />
</CreateItem>
<Copy SourceFiles="@(Content)" 
DestinationFiles="@(Content -> '$(DNNDirectory)\
                         DesktopModules\$(ModuleFolder)\%(Identity)')" 
          SkipUnchangedFiles="true" />
<Copy SourceFiles="@(ModuleAssemblies);@(ModuleDebug)" 
DestinationFolder="$(DNNDirectory)\bin" />
<Copy SourceFiles="@(Content)" 
DestinationFiles="@(Content -> '$(MSBuildProjectDirectory)\Package\%(Identity)')" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(ModuleAssemblies);" 
DestinationFolder="$(MSBuildProjectDirectory)\Package\bin" />
<CreateItem Include="$(MSBuildProjectDirectory)\Package\**\*.*">
<Output TaskParameter="Include" ItemName="OutputContent" />
</CreateItem>
<Zip Files="@(OutputContent)" 
WorkingDirectory="$(MSBuildProjectDirectory)\Package" 
ZipFileName="$(ProjectName)_$(Major).$(Minor).$(Build)_Install.zip" />
</Target>

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.

 

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.

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. 

  1. Add a new User Control to the Web project and call it View.ascx.
  2. Add another User Control and call it Settings.
  3. Add a reference to the DotNetNuke.dll file.
  4. Open up the View.ascx file and paste the following in:
    <script type="text/javascript">
    function onSilverlightError(sender, args) {
    var appSource = "";
    if (sender != null && sender != 0) {
                appSource = sender.getHost().Source;
            } var errorType = args.ErrorType;
    var iErrorCode = args.ErrorCode;
    if (errorType == "ImageError" || errorType == "MediaError") {
     return;
            }
    var errMsg = "Unhandled Error in Silverlight Application " + 
            appSource + "\n";
            errMsg += "Code: " + iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";
    if (errorType == "ParserError") {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
    else if (errorType == "RuntimeError") {
     if (args.lineNumber != 0) {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " + args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }
    throw new Error(errMsg);
        }
    </script>
     
    <div id="silverlightControlHost" style="position: relative; 
        width: 100%; height: 500px;
        vertical-align: top; z-index: 50;">
    <object data="data:application/x-silverlight-2," 
    type="application/x-silverlight-2"
    width="100%" height="100%">
    <param name="source" value='<%=SilverlightApplication %>'/>
    <param name="onError" value="onSilverlightError" />
    <param name="background" value="Transparent" />
    <param name="windowless" value="true" /> 
    <param name="minRuntimeVersion" value="3.0.40624.0" />
    <param name="autoUpgrade" value="true" />
    <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none">
     <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"
     style="border-style: none" />
    </a>
    </object>
    <iframe id="_sl_historyFrame" style="visibility: 
            hidden; height: 0px; width: 0px;
            border: 0px"></iframe>
    </div>
  5. Open up the code behind file and modify it to look like this.
    public partial class View : PortalModuleBase
    {
    public string SilverlightApplication { get; set; }
    public string SilverlightInitParams { get; set; }
    protected void Page_Load(object sender, EventArgs e)
    {
    bool isChecked;
    var xapFile = "MySilverlightApplication.xap";if (bool.TryParse(Settings["IsTest"].ToString(), out isChecked))
    {
    if (isChecked)
    xapFile = "MySilverlightApplication.SLTest.xap";
    }
    // Register Silverlight.js file
    Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "SilverlightJS", (String.Format(@"{0}{1}", 
    TemplateSourceDirectory, "/Silverlight.js")));// Set the path to the .xap file
    SilverlightApplication = String.Format("{0}/ClientBin/{1}", 
    TemplateSourceDirectory, xapFile);// Pass the Initialization Parameters to the Silverlight Control
    SilverlightInitParams = string.Format("Test={0}", "Some init stuff");
    }
    }
  6. In the settings file add a check box and save its value as a setting and call the setting “IsTest”.
  7. Now build you solution.
  8. You are now ready to register your module with DotNetNuke so go ahead and do that.

That’s it for Part 1.  You are now set up ready to start developing, designing and testing your application. 

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. 

I went to a bunch of Silverlight/UX sessions by Shane Morris (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 :)

Jordan and Mahesh who both work with me at Readify 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.

I also went to see John and Bronwen from Soul Solutions 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.

Thanx everyone who I met and caught up with it was a great time.

THG002 Integrating Silverlight with your DotNetNuke sites

Presenter: Philip Beadle

Wed 9/9 | 12:45-13:15 | Green Interactive Theatre

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.

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.

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.

avatar-trustee

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.

I am writing a new Dummies book due out in a couple of montsh with my Readify colleague Mahesh.  Check out the blurb here http://au.wiley.com/WileyCDA/WileyTitle/productCd-0470524650.html

Read More »

  
DNN Template Maker

Artisteer - Web Design Generator

  
UsersOnline
MembershipMembership:
Latest New UserLatest:Ian
Past 24 HoursPast 24 Hours:0
Prev. 24 HoursPrev. 24 Hours:0
User CountOverall:29

People OnlinePeople Online:
VisitorsVisitors:7
MembersMembers:0
TotalTotal:7

Online NowOnline Now:
  
Talk to me
  
Good Books
My Logos


MVP Logo
From: 2004-2009

Lorraine Young's DNN Site

DotNetNuke Sponsor and Platinum Benefactor logo

 Microsoft ASP.net logo

microsoftcertifiedprofessional.gif

vicnet_logo.gif