コード例 #1
0
        // Token: 0x06005975 RID: 22901 RVA: 0x0018B004 File Offset: 0x00189204
        private static void OnValidationAdornerSiteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.IsASubPropertyChange)
            {
                return;
            }
            DependencyObject dependencyObject  = (DependencyObject)e.OldValue;
            DependencyObject dependencyObject2 = (DependencyObject)e.NewValue;

            if (dependencyObject != null)
            {
                dependencyObject.ClearValue(Validation.ValidationAdornerSiteForProperty);
            }
            if (dependencyObject2 != null && d != Validation.GetValidationAdornerSiteFor(dependencyObject2))
            {
                Validation.SetValidationAdornerSiteFor(dependencyObject2, d);
            }
            if (Validation.GetHasError(d))
            {
                if (dependencyObject == null)
                {
                    dependencyObject = d;
                }
                Validation.ShowValidationAdornerHelper(d, dependencyObject, false);
                Validation.ShowValidationAdorner(d, true);
            }
        }