typemismatch

just a projection of my own imagination

  • You are here: 
  • Home
  • silverlight tips

Silverlight Tip – Initialize!

Posted on October 20th, 2008

Wow, who said learning new stuff wasn’t fun! :) Here is another little gem I found which will change your understanding of how Silverlight applications work.

I had a little application that was working great, it even had a bunch of nifty video things taking place in the code behind. I wanted to redo my layout and so cleaned out the old code, built my new layout and then something went wrong.

I just got a blank web page with no errors, compiler error or warnings – just no Silverlight control. I checked and checked and recompiled and cleaned cache and had a beer – still nothing.

So I created a new project and test xaml page and that worked fine – then I looked at the code behind and spotted the issue. The code below is added by default and IS required – I had accidentally removed it when cleaning up, must be getting old ;-)

You must have the following in your code behind page (user control class)

public Page()
{
    InitializeComponent();
}

Pretty simple but something you can delete and not notice until nothing works :) Silly me.

Tags:
Filed under Software | No Comments »

Silverlight Tip – Grid layouts

Posted on October 20th, 2008

Just a simple tip if you haven’t already tried to use these layout controls.

When you are creating content (controls) to add to the grid via a Row and Column number it would help if you knew the index is 0 (Zero) based …. that would be Column 0, Row 0 for the top left corner and not 1,1 as it should be :)

Enjoy!

Tags:
Filed under Software | No Comments »