Is there any way to force wpf to run the value converter again on a specific event?
+1
A:
You can force WPF to update a binding by calling BindingExpression.UpdateTarget
(and, for certain bindings, BindingExpression.UpdateSource
). If the binding involves a converter, then the converter will run as part of that update.
To get the BindingExpression for a bound property, call BindingOperations.GetBindingExpression
.
itowlson
2010-03-14 21:09:15
Is there no way to do it from XAML like UpdateEvent=blablabla??
Petoj
2010-03-14 21:19:55
No. WPF only knows about dependency properties and INotifyPropertyChanged on the source (data object) side, and dependency properties and focus events on the target (UI element) side. If you want to listen for a different event and force an update on that other event, you must do so in code. Sorry.
itowlson
2010-03-14 21:38:48