WPF - ItemsControl - Como encontro meu item "CheckBox" que está no ItemTemplat
Tenho o seguinte (muito simples) ItemsControl:
<ItemsControl Name="BlahList" ItemsSource="{Binding Blah}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<CheckBox Name="MyCheckBox" Content="{Binding Text}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
No código, eu gostaria de fazer o seguinte:
foreach (var dahCurrentItem in BlahList.Items)
{
var ItemCheckBox = BlahList.GimmeMyControl(dahCurrentItem, "MyCheckBox")
// I'm going to do something with the check box here...
}
Como faço isso