Validation.ErrorTemplate 附加屬性

定義

取得或設定用於裝飾項層上產生驗證錯誤回應的 ControlTemplate

see GetErrorTemplate, and SetErrorTemplate
see GetErrorTemplate, and SetErrorTemplate
see GetErrorTemplate, and SetErrorTemplate

備註

WPF 資料系結模型可讓您與 Binding 物件產生關聯 ValidationRules 。 如果使用者輸入不正確值,您可能會想要在應用程式使用者介面上提供一些有關錯誤的意見反應, (UI) 。 提供這類意見反應的其中一種方式是設定 ValidationErrorTemplate 附加屬性至自訂 ControlTemplate

如需驗證的詳細討論,請參閱 資料系結概觀的資料驗證一節。

相依性屬性資訊

識別碼欄位 ErrorTemplateProperty
設定為 的中繼資料屬性 true IsNotDataBindable

適用於

另請參閱