The analyzer detected a possible error related to dependency property registration. A dependency property was defined but wasn't initialized: it will cause an error when trying to access the property using SetValue / GetValue.
class A : DependencyObject
{
public static readonly DependencyProperty CurrentTimeProperty;
static A(){ /* CurrentTimeProperty not initialized */ }
....
Bad refactoring or copy-paste may result in leaving a dependency property unregistered. The following is the fixed version of the code above:
class A : DependencyObject
{
public static readonly DependencyProperty CurrentTimeProperty;
static A()
{
CurrentTimeProperty =
DependencyProperty.Register("CurrentTime", typeof(DateTime),
typeof(A));
}
....
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders:
Take
a chance!