What's the equivalent of DependencyPropertyDescriptor.AddValueChanged() ?
I'm porting a library from WPF to Noesis, which requires other objects to be notified when property changes.
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: What's the equivalent of DependencyPropertyDescriptor.AddValueChanged() ?
I'm sorry DependencyPropertyDescriptor is not implemented yet (#822). But you can use attached properties to add your own PropertyChangedCallback and bind to the desired property to be notified when the source property changes:
Is this something you can use in your project?
Code: Select all
public static readonly DependencyProperty ChangeListenerProperty = DependencyProperty.RegisterAttached(
"ChangeListener", typeof(object), typeof(PropertyHelper),
new PropertyMetadata(null, OnValueChanged));
private void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
// your code here...
}Code: Select all
someTextBox.SetBinding(PropertyHelper.ChangeListenerProperty, new Binding(TextBox.TextProperty, someTextBox);Re: What's the equivalent of DependencyPropertyDescriptor.AddValueChanged() ?
It will do, thanks! 👍
Who is online
Users browsing this forum: No registered users and 7 guests