How to access a Checkbox inside Listbox?

前端 未结 5 1881
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 14:40

I have a listbox and I have set the itemstemplate as shown below.

XAML:

            
                       


        
5条回答
  •  [愿得一人]
    2021-01-03 15:15

    If you're already binding to the Title property in the item template then it would certainly make sense to bind to IsChecked, too.

    If you really need to, you can walk the visual tree by using the VisualTreeHelper to find the CheckBox instances.

提交回复
热议问题