这是我的第一个问题。 我开始使用WPF,并且卡住了。这里的问题是: 我有一个ListView如下:WPF ListView问题
<UserControl.Resources>
<DataTemplate x:Key="FirstCell">
<StackPanel Orientation="Horizontal">
<CheckBox Margin="2"></CheckBox>
</StackPanel>
</DataTemplate>
</UserControl.Resources>
<ListView Name="lvRights">
<ListView.View>
<GridView>
<GridViewColumn Width="100" Header="Select" CellTemplate="{StaticResource FirstCell}"/>
<GridViewColumn Width="200" Header="Right" DisplayMemberBinding="{Binding Path=Name}" />
</GridView>
</ListView.View>
</ListView>
我的列表结合“角色”,其中有只有标识和名称的集合。 我正在使用该DataTemplate在第一列中显示一个复选框。
这里是问题:
我怎么能知道用户在运行时是否检查复选框之一?在列表视图的.Items属性中,我拥有角色,但我无法获取有关第一列的任何信息。
我有这样的感觉,这是简单的,但不知何故,我错过了答案。
提前10倍。
我在想现在这也是一个设计问题,因为我**应该**在角色中的信息。该死的。仍然问题仍然存在,我迫不及待地想通过wpf来克服noob阶段... – Teodor 2009-06-16 15:05:53