posts from 2008

Silverlight 2.0 Cross Domain Policy File Checker

By Fons Sonnemans, 18-dec-2008

In order to make Cross Domain calls in Silverlight 2 applications, the server you wish to download data from must have a Policy File in place that allows access to your site. I have created a Silverlight Application in which you can check the content of the Policy Files (if exists).

Click on the image below to try the application

Try application


Silverlight 2.0 Locator for Objectmap

By Fons Sonnemans, 10-nov-2008

I have created a new Silverlight 2 Control which is used in the Objectmap website. This control makes it easy for the customers of accounts to find their nearest object (branch, offices or sales outlet). They can also immediately retrieve dynamic directions to this location or link to a more info page.

Have a look at this demopage, sorry in Dutch only.

This control uses: Cross Domain WCF networking, Data Binding, Isolated Storage Settings, Google Maps API calls, Cross Domain HTML Bridge and Styling.


Silverlight 2.0 Minesweeper

By Fons Sonnemans, 23-okt-2008

Earlier I have created a WPF and a Windows Forms version of Minesweeper. Today I proud to show you my Silverlight 2.0 (RTW) version. Click on the image below to play this version.

You can download the C# source code and the example website here.


SQL Server 2008 HierarchyID Data Type

By Fons Sonnemans, 15-okt-2008

The Dutch Microsoft .NET magazine #22 (September 2008) contains an article I have written an Introduction to the SQL Server 2008 HierarchyID Data Type. You can download the complete source of the article here. In this source I also fixed the problem with the IsDescendant() method. This method was renamed in RC0, my article was based on a Beta. The method is renamed to IsDescendantOf() and the argument has also changed.

The article is available online in PDF format on Please note that the article is in Dutch. The complete .NET magazine #22 is available online here.

Tags: SQL


Hello World in Silverlight 2 using Visual Studio 2008 SP1 Video

By Fons Sonnemans, 09-okt-2008

Dit is mijn eerste Silverlight 2 instructie video. In deze video toon ik hoe je een eenvoudige Hello World applicatie kunt opzetten met behulp van Silverlight 2 (RC0) en Visual Studio 2008 met Service Pack 1.

Toon Video

Download de sourcecode. Zorg er wel voor dat je alle benodigde software geinstalleerd hebt.


Fix the ASP.NET Themes with IE8’s X-UA-Compatible header problem

By Fons Sonnemans, 26-sep-2008

If you’ve got a page that doesn’t render correctly in IE8’s new standards mode, you can add a meta tag to the page which requests that IE8 render it in IE7 mode. IE8 only recognizes the X-UA-Compatible header if it’s the first META tag, appearing immediately after thetag.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
  <head  id="Head1" runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="shortcut icon" href="favicon.ico" />
Tags: Web, ASP.NET


PEAK-IT Summer DevNight 2008

By Fons Sonnemans, 04-jul-2008

On Juny 3, I did a Visual Studio 2008 presentation on the PEAK-IT Summer DevNight 2008 at the Fulcotheater in IJsselstein.

You can download the slide deck here.

I had a good time presenting this sessions. I hope it was a useful for you as well.


Silverlight 2.0 RollMenu

By Fons Sonnemans, 24-jun-2008

I have created a RollMenu control in Silverlight 2 Beta 2. It uses an Xml file to configure the menu items.

Click on following image for a live demo.

Live Demo


Hot Technologies Day

By Fons Sonnemans, 18-jun-2008

On June 17, I did two sessions on the Hot Technologies Day for Achmea (Interpolis) in Tilburg. I have given many trainings (C#, ASP.NET 2.0, AJAX, SQL2005, VS2008) at Achmea the last year. It is a very innovative company and very fun to work for.

This Hot Technologies Day was a mini seminar with 4 sessions: Silverlight 2, VSTS DB Pro, LINQ + Entity Framework, Microsoft Office SharePoint Server. Here is a picture of me taken during the Silverlight 2 session:

In the Silverlight 2 session I gave an overview of Silverlight 2 Beta 2. You can download the slide deck here.

In the LINQ + Entity Framework session I gave an overview of C# 3.0, LINQ, LINQ to SQL and Entity Framework. You can download the slide deck here.


Generic BidirectionalAssociationCollection

By Fons Sonnemans, 25-mrt-2008

Bidirectional associations are easy to design but difficult to program. You must write lot's of synchronization code with the risk of making mistakes. Have a look at the following example in which there is a bidirectional association between Employee (Employer) and Company (Employees).

The synchronization code is implemented in the AddEmployee(), RemoveEmployee() and the (Set)Employer methods.

  class Employee {

    publicstring Name { get; set; }
    publicdecimal Salary { get; set; }

    private Company _employer;

    public Company Employer {
        get {
            return _employer;
        set {
            if (Employer != value) {
                // Remove from 'old' Employerif (Employer != null) {
                    Company old = _employer;
                    this._employer = null;

                // Set the Employer    this._employer = value;
                // Add to 'new' Employerif (Employer != null) {

publicclass Company {

    publicstring Name { get; set; }

    privatereadonly List<Employee> _employees = new List<Employee>();

    publicvoid AddEmployee(Employee emp) {
        if (!_employees.Contains(emp)) {
            emp.Employer = this;  // Synchronize

    publicvoid RemoveEmployee(Employee emp) {
        if (_employees.Contains(emp)) {
            emp.Employer = null; // Synchronize
Tags: CSharp


All postings/content on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer or sponsors. The content on this site is licensed under a Creative Commons Attribution By license.