Ok so I have a test control that derives from Panel. I added new dependency property to it.
public class TestPanel : Panel
{
public static DependencyProperty TestProperty = DependencyProperty.Register(
"Test",
typeof(double),
typeof(TestPanel),
new FrameworkPropertyMetadata(
0.0,
null));
public double Test
{
get
{
return (double)this.GetValue(TestProperty);
}
set
{
this.SetValue(TestProperty, value);
}
}
}
I then defined it in xaml <controls:TestPanel Test="50" />
But now I wonder, why the setter of Test is not called? Shouldn't it pass value(50)? I get default value (0.0) during arrange pass.
Or is it only valid using the binding instead?