If you create a Silverlight (and probably WPF) usercontrol and get a DP_DefaultValueTypeDoesNotMatchPropertyType error when rendering the control, make sure you are setting the right kind of default value in the .Register method.
The following code generated that error.
public static readonly DependencyProperty HourFillProperty = DependencyProperty.Register(
"HourFill", typeof(int), typeof(ucScheduleHour),
new PropertyMetadata(null,
new PropertyChangedCallback(ChangeValue)));
My value was an int so I needed to change null to a 0,
public static readonly DependencyProperty HourFillProperty = DependencyProperty.Register(
"HourFill", typeof(int), typeof(ucScheduleHour),
new PropertyMetadata(0,
new PropertyChangedCallback(ChangeValue)));
Showing posts with label XAML. Show all posts
Showing posts with label XAML. Show all posts
Wednesday, September 1, 2010
Subscribe to:
Posts (Atom)