INotifyDataErrorInfo.GetErrors(String) 方法

定義

取得指定之屬性或整個實體的驗證錯誤。

public:
 IIterable<Platform::Object ^> ^ GetErrors(Platform::String ^ propertyName);
IIterable<IInspectable> GetErrors(winrt::hstring const& propertyName);
public IEnumerable<object> GetErrors(string propertyName);
function getErrors(propertyName)
Public Function GetErrors (propertyName As String) As IEnumerable(Of Object)

參數

propertyName
String

Platform::String

winrt::hstring

要擷取驗證錯誤的屬性名稱。 Null 或空白會擷取實體層級錯誤。

傳回

IIterable<Object>

IEnumerable<Object>

IIterable<Platform::Object>

IIterable<IInspectable>

屬性或實體的驗證錯誤。

備註

這個方法會傳回可隨著非同步驗證規則完成處理而變更的 IEnumerable 。 這可讓系結引擎在新增、移除或修改錯誤時自動更新使用者介面驗證意見反應。

傳回值可以變更為不同的 IEnumerable,或者可以重複使用先前傳回的 IEnumerable 並變更其內容。 傳回值的任何變更都應該引發 ErrorsChanged 事件,即使傳回值實作 INotifyCollectionChanged也一樣。

適用於