Catel.Windows.SetterValueBindingHelper.OnPropertyBindingPropertyChanged C# (CSharp) Метод

OnPropertyBindingPropertyChanged() приватный статический Метод

Change handler for the PropertyBinding attached DependencyProperty.
private static OnPropertyBindingPropertyChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
d System.Windows.DependencyObject Object on which the property was changed.
e System.Windows.DependencyPropertyChangedEventArgs Property change arguments.
Результат void
        private static void OnPropertyBindingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            // Get/validate parameters
            var element = (FrameworkElement)d;
            var item = (SetterValueBindingHelper)e.NewValue;

            if (null != item)
            {
                // Item value present
                if ((null == item.Values) || (0 == item.Values.Count))
                {
                    // No children; apply the relevant binding
                    ApplyBinding(element, item);
                }
                else
                {
                    // Apply the bindings of each child
                    foreach (var child in item.Values)
                    {
                        if ((null != item.Property) || (null != item.Binding))
                        {
                            throw new ArgumentException("A SetterValueBindingHelper with Values may not have its Property or Binding set.");
                        }

                        if (0 != child.Values.Count)
                        {
                            throw new ArgumentException("Values of a SetterValueBindingHelper may not have Values themselves.");
                        }

                        ApplyBinding(element, child);
                    }
                }
            }
        }