Validation.GetErrors(DependencyObject) 方法

定义

获取指定元素的 Errors 附加属性的值。

public:
 static System::Collections::ObjectModel::ReadOnlyObservableCollection<System::Windows::Controls::ValidationError ^> ^ GetErrors(System::Windows::DependencyObject ^ element);
public static System.Collections.ObjectModel.ReadOnlyObservableCollection<System.Windows.Controls.ValidationError> GetErrors (System.Windows.DependencyObject element);
static member GetErrors : System.Windows.DependencyObject -> System.Collections.ObjectModel.ReadOnlyObservableCollection<System.Windows.Controls.ValidationError>
Public Shared Function GetErrors (element As DependencyObject) As ReadOnlyObservableCollection(Of ValidationError)

参数

element
DependencyObject

要从中读取值的 UIElementContentElement 对象。

返回

一个由 ReadOnlyObservableCollection<T> 对象构成的 ValidationError

例外

如果 elementnull

适用于