Software
Software - Monday, October 20, 2008 21:04 - 0 Comments
Silverlight Tip - Initialize!
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.
Most Popular Content
- Setting up a Windows image in Amazon’s EC2
- Amazon goes live with Windows in the Cloud
- Silverlight Tip - Initialize!
- Silverlight Tip - Grid layouts
- Selecting a single LINQ2SQL Entity
- What kind of error handling is this?
- Silverlight and Google searches
- Goodbye iPhone 3G
- Gadget Features!
- iPhone Battery Tip
- Oh come on Microsoft ….