How to dynamically access element names in XAML?

前端 未结 2 767
小鲜肉
小鲜肉 2021-02-07 10:19

I have a XAML input form which the user fills out.

I want to validate this form.

I have the field information in a collection which I want to loop through and ch

相关标签:
2条回答
  • 2021-02-07 11:12

    Also if you are willing to add UI elements from code behind you will have to use the RegisterName("Field_CompanyName", some_instance) method call as FindName works by default only for elements declared within XAML.

    0 讨论(0)
  • 2021-02-07 11:13

    Isn't that just a FindName call in you code behind file or am I missing something?

    TextBox fieldTB = (TextBox)this.FindName("Field_CompanyName");
    
    0 讨论(0)
提交回复
热议问题