If you want to listen to changes of a dependency property, you can subclass the type that defines the property and override the property metadata and pass an PropertyChangedCallback. But an much easier way is to get the DependencyPropertyDescriptor and hookup a callback by calling AddValueChanged()
DependencyPropertyDescriptor textDescr = DependencyPropertyDescriptor. FromProperty(TextBox.TextProperty, typeof(TextBox)); if (textDescr!= null) { textDescr.AddValueChanged(myTextBox, delegate { // Add your propery changed logic here... }); }
浙公网安备 33010602011771号