Access a control from within a DataTemplate with its identifying name

前端 未结 3 1825
醉话见心
醉话见心 2020-12-10 22:14

In my WPF application I have a ComboBox control that is located inside a Grid Control. In XAML I am assigning a name to the ComboBox:



        
3条回答
  •  一生所求
    2020-12-10 22:51

    First you have to get access to the control template which it has been applied to, then you can find an element of the template by name. Have a look at the MSDN knowledge base :

    • How to: Find ControlTemplate-Generated Elements

提交回复
热议问题