The CLR style getters and setters of DependencyProperty
s are not meant to be called by the Framework... they are there for developers to use in code. If you want to know when a DependencyProperty
value has changed, you need to add a handler:
public static readonly DependencyProperty TargetValueProperty =
DependencyProperty.Register("TargetValue", typeof (int), typeof (ProgressEx),
new FrameworkPropertyMetadata(0, OnTargetValueChanged));
private static void OnTargetValueChanged(DependencyObject dependencyObject,
DependencyPropertyChangedEventArgs e)
{
// Do something with the e.NewValue and/or e.OldValue values here
}