follow the code @manicasteroid

Silverlight Tip – Initialize!

Posted on October 20, 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:

  • http://www.google.com Kurtis Cuther

    Sick of obtaining low numbers of useless visitors to your site? Well i wish to let you know about a new underground tactic that makes myself $900 on a daily basis on 100% AUTOPILOT. I could be here all day and going into detail but why dont you just check their site out? There is really a great video that explains everything. So if your serious about producing easy hard cash this is the website for you. Auto Traffic Avalanche