Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to intercept WPF binding for custom processing

Tags:

.net

binding

Say you have a window with 20 textboxes on it which are all bound to different BLL classes. How do I intercept a value being passed from a textbox to a property when binding with wpf? I'm looking for a generic solution instead of doing this for every property.

I can inherit from the Binding class, but is there an event in that class I can listen to whenever data is passed from an uielement to a property? Or is there a better solution?

like image 737
Elger Mensonides Avatar asked Jul 18 '26 17:07

Elger Mensonides


1 Answers

The Binding has a Converter property to which you can assign a class that implements IValueConverter. If you can inherit from binding, maybe you can set the Converter in that specialization and go on with that.

like image 187
flq Avatar answered Jul 21 '26 05:07

flq



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!