Normal Properties vs. Dependency Properties

In the Silverlight development world there are two kinds of properties that you can have on a Silverlight control: normal C# properties and dependency properties.  The normal C# properties are added to a Silverlight control the same way as they would be added to any C# class: public string MyProperty { get; set; } And…


How do I get the height/width of a Silverlight UIElement if its not explicitly set?

The answer is, of course, to use the ActualHeight and ActualWidth properties. But wait, ActualHeight and ActualWidth return 0.0, what gives?  Well it turns out that if you just check the ActualHeight and ActualWidth right away, you are getting the measurements of the element BEFORE it has been measured and sized.  The way to accurately…

1

“The property ‘_UnknownContent’ does not exist…” What?

I was working on a custom Control the other day and that had its own XAML file.  I had it all coded up, but when I went to build it, it gave me the following two errors: Error    6    The property ‘_UnknownContent’ does not exist on the type ‘ResourceDictionary’ in the XML namespace ‘http://schemas.microsoft.com/winfx/2006/xaml/presentation’.    C:\Source\Controls\MyControl.xaml…

2