I would like to know if there is a mechanism to intercept all the bindings so that I can suppress the update in a certain state?
Pseudocode:
public class Utils
{
public void RegisterInterceptionOfBinding()
{
WpfBindingMechanism.OnSourceUpdating += SourceUpdating;
WpfBindingMechanism.OnTargetUpdating += TargetUpdating;
}
private void SourceUpdating(object sender, SourceUpdatingEventArgs args)
{
if (DoSomeMagicConditionChecking)
{
args.Cancel = true;
}
}
private void TargetUpdating(object sender, SourceUpdatingEventArgs args)
{
if (DoSomeMagicConditionChecking)
{
args.Cancel = true;
}
}
}
I am looking for a mechanism that works with ALL bindings throughout an WPF application.
source
share