WPF Binding Updates

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.

+4
source share
1 answer

You might want to use a class TypeDescriptionProvider.

Here is a MSDN post that might answer your question:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/d8046807-ac1a-4d1f-81f2-6a2f93dab78a/intercept-binding-mechanism

+1
source

All Articles