How to access a child control's property when it is declared in a ControlTemplate?
问题 I have a GridView in which I want to embed a checkbox into the header of one of the columns. I need to check it's IsChecked property in code-behind. However, I cannot access it by name as it is in a template for the column header like below: <ListView.View> <GridView> <GridViewColumn> <GridViewColumn.HeaderContainerStyle> <Style TargetType="{x:Type GridViewColumnHeader}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GridViewColumnHeader}" > <Border