Why create DependencyProperty member in this way:
public static readonly DependencyProperty DepProperty = DependencyProperty.Register(...);
and not in that way:
protected static readonly DependencyProperty DepProp = DependencyProperty.Register(...);
Why do we need to use the DevProp member from outside when we have the CLR “wrappers”:
public bool Dep
{
get { return (bool)GetValue(DepProperty); }
set { SetValue(DepProperty, value); }
}
According to MSDN, restrictive access modifiers don’t actually provide the intended access protection from certain APIs, so there’s no point declaring dependency properties and their identifier fields anything other than
public:It doesn’t do any harm exposing them as
publicanyway, I’d gather.