开发者

WPF: change binding properties for multiple controls

开发者 https://www.devze.com 2022-12-24 04:51 出处:网络
I\'d like that all the Text bindings for the TextBoxes in my UserControl to have UpdateSourceTrigger=PropertyChanged, and ValidatesOnDataErrors=True

I'd like that all the Text bindings for the TextBoxes in my UserControl to have UpdateSourceTrigger=PropertyChanged, and ValidatesOnDataErrors=True

How to do it ?

I can think of a solution: use another class for bindings (a class inheriting Binding) but maybe there is another solution, ma开发者_JAVA技巧ybe using a style or template ?


You can't do it with a style or template, since a binding is not a FrameworkElement. But your idea of a class inheriting Binding should work fine, I've done the same before for a similar problem

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号