所以,我有LongListSelector
aCheckBox
并且它绑定到一个List<People>
对象
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Width="Auto">
<CheckBox Tap="CheckedBox"/>
<TextBlock Text="{Binding FirstName}" FontSize="{StaticResource PhoneFontSizeLarge}"/>
<TextBlock Text=" "/>
<TextBlock Text="{Binding LastName}" FontSize="{StaticResource PhoneFontSizeLarge}"/>
</StackPanel>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
我有以下事件处理程序
private void CheckedBox(object sender, RoutedEventArgs e)
{
if ((bool)(((CheckBox)sender).IsChecked))
{
(Person)LongList1.SelectedItem).Attend[(App.Current as App).eventCount] = 'Y';
}
}
这是不一致的。我该如何解决这个问题,以便我可以使用该CheckBox
值来更改LongListSelectorItem
链接到的对象?