Passing parameters to a Silverlight XAP application

In this post two ways to pass parameters to an in-browser Silverlight application without modifying the XAP are described:

  • Using the querystring of the containing HTML/ASP.NET page
  • Using the InitParams attribute of the object tag that hosts the XAP file

The first method is straight forward: just add a querystring to the URL. You can retrieve the querystring using the HtmlPage.Document like this (based on code from MSDN):

private void Application_Startup(object sender, StartupEventArgs e)
{
Page p = new Page();
this.RootVisual = p;

// This assumes that Page.LayoutRoot exists and is a StackPanel.
Continue Reading

Code generators for generating strongly typed resource classes for Visual Studio 2010

Guy Smith Ferrier created some code generators for use with Silverlight. Unfortunately, as noted by Don Ruiter these generators do not install in Visual Studio 2010. In this blog he outlines the steps to modify the installer to work with Visual Studio 2010.

Because he did not post the resulting installer, I have performed these steps myself. The resulting installer can be downloaded here.

Update

As can be read here Guy Smith Ferrier has updated his downloads, so the resulting installer can be downloaded here too.

Determining leaked objects

A while back I noticed that Pochet.NET was suffering from a memory leak, probably caused by some event handlers that were not properly removed. Although I had a hunch about what objects were leaking, I was not quite sure. That is why I decided to create the MemoryLeakDetector helper class. The sole purpose of this class is to keep track of how many instances of a specific type are active (i.e. not garbage collected).

This class can be used in the following ways: you can use the MemoryLeakDetector as the base class, like this:

public class MyClass : MemoryLeakDetector
{
Continue Reading

Forcing the browser to use the latest XAP file

During the development of Pochet.NET I have noticed that sometimes during debugging sessions the browser is not using the latest build of the XAP file but rather the one that is stored in the browser cache. This problem can be solved by appending a querystring to the URL of the XAP file and change this query string on every build. The following code does that by appending the time of the XAP file to the URL of the XAP file.

protected override void OnLoad(EventArgs e)
{
Continue Reading

Hello Pochet.NET!

Pochet is an ongoing project in which a framework for line-of-business application is developed. This framework has had many incarnations (Clipper, VB6, ASP.NET) and is successfully used in quite a few applications. Sometime ago the decision has been made to rebuild this framework in Silverlight and release it as open source.

This blog is about the development of this new version and everything of interest related to it.

Page 2 of 212