System.Waf.Presentation.ValidationHelper.IsValidChangedCallback C# (CSharp) Method

IsValidChangedCallback() private static method

private static IsValidChangedCallback ( DependencyObject obj, System.Windows.DependencyPropertyChangedEventArgs e ) : void
obj System.Windows.DependencyObject
e System.Windows.DependencyPropertyChangedEventArgs
return void
        private static void IsValidChangedCallback(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            if (!GetIsEnabled(obj))
            {
                throw new InvalidOperationException("The IsValid attached property can only be used when the IsEnabled "
                    + "attached property is set to true.");
            }

            Binding binding = BindingOperations.GetBinding(obj, IsValidProperty);
            if (binding != null)
            {
                CheckBindingMode(binding.Mode);
                return;
            }

            MultiBinding multiBinding = BindingOperations.GetMultiBinding(obj, IsValidProperty);
            if (multiBinding != null)
            {
                CheckBindingMode(multiBinding.Mode);
                return;
            }

            PriorityBinding priorityBinding = BindingOperations.GetPriorityBinding(obj, IsValidProperty);
            if (priorityBinding != null)
            {
                throw new InvalidOperationException("PriorityBinding is not supported for the IsValid attached dependency property!");
            }
        }