【发布时间】:2009-03-02 17:30:52
【问题描述】:
我有以下(非常简单的)ItemsControl:
<ItemsControl Name="BlahList" ItemsSource="{Binding Blah}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<CheckBox Name="MyCheckBox" Content="{Binding Text}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
在代码中,我想做以下事情:
foreach (var dahCurrentItem in BlahList.Items)
{
var ItemCheckBox = BlahList.GimmeMyControl(dahCurrentItem, "MyCheckBox")
// I'm going to do something with the check box here...
}
我该怎么做?
【问题讨论】:
标签: wpf itemscontrol