Setting Validation error template from code in WPF

前端 未结 4 1296
醉话见心
醉话见心 2021-02-13 22:40

I have a TextBox in my WPF app. I have defined a ControlTemplate for validation error as follows:


    

        
4条回答
  •  心在旅途
    2021-02-13 22:51

    Validation.SetErrorTemplate(txtBox, this.FindResource("validationTemplate") as ControlTemplate);
    

提交回复
热议问题