Validation.SetErrorTemplate(DependencyObject, ControlTemplate) 方法

定義

ErrorTemplate 附加屬性的值設定為指定的項目。

public:
 static void SetErrorTemplate(System::Windows::DependencyObject ^ element, System::Windows::Controls::ControlTemplate ^ value);
public static void SetErrorTemplate (System.Windows.DependencyObject element, System.Windows.Controls.ControlTemplate value);
static member SetErrorTemplate : System.Windows.DependencyObject * System.Windows.Controls.ControlTemplate -> unit
Public Shared Sub SetErrorTemplate (element As DependencyObject, value As ControlTemplate)

參數

element
DependencyObject

要設定 valueUIElementContentElement 物件。

value
ControlTemplate

用於裝飾項層上產生驗證錯誤回應的 ControlTemplate

例外狀況

如果 elementnull

適用於