internal static void SetScope(DependencyObject obj, ValidationScope value) { obj.SetValue(ScopeProperty, value); }
private static void OnErrorSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args) { var fe = obj as FrameworkElement; if (fe != null) { // check if there is a scope object created yet on this control. If not create one // and attach it to the point in the Logical Tree that defining the scope. var scopeObject = GetScope(fe); if (scopeObject == null) { scopeObject = new ValidationScope(fe); SetScope(obj, scopeObject); } scopeObject.ErrorSource = args.NewValue as ICollection<IError>; } }