1

Is there a CallBack After PropertyChangedCallBack ? because in the PropertyChangedCallBack the change hasn't been made yet. In the example below after I set MyProperty and when Foo() is being called, MyProperty still got the old value in Foo(). I want to be able to call Foo() just after I change MyProperty with the new value

public int MyProperty
{
    get { return (int)GetValue(MyPropertyProperty); }
    set { SetValue(MyPropertyProperty, value); }
}

public static readonly DependencyProperty MyPropertyProperty =
    DependencyProperty.Register("MyProperty", typeof(int), typeof(ownerclass), new PropertyMetadata(0, MyProperty_PropertyChanged));

private static void MyProperty_PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var self = (ownerclass)d;
    d.Foo();
}

void Foo()
{
    //-->old value of MyProperty
}
ihisham
  • 248
  • 1
  • 10
  • You can get the new value from the [event args](https://msdn.microsoft.com/en-us/library/system.windows.dependencypropertychangedeventargs.newvalue(v=vs.110).aspx). – John Wu Nov 30 '17 at 18:02

0 Answers0