語言

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 或 Empty 可檢索實體層級錯誤。

傳回

IIterable<Object>

IEnumerable<Object>

IIterable<Platform::Object>

IIterable<IInspectable>

屬性或實體的驗證錯誤。

備註

此方法回傳一個 IEnumable ,隨著非同步驗證規則完成處理,該 IEnumable 可能會改變。 這使得綁定引擎能在錯誤新增、移除或修改時自動更新使用者介面驗證回饋。

回傳值可以改變成不同的 IEnumerable,或是重複使用先前回傳的 IEnumerable 並更改其內容。 任何對回傳值的變更都應該會觸發 ErrorsChanged 事件,即使該回傳值實作了 INotifyCollectionChanged。

適用於