Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 列表<&燃气轮机;WP7本地数据库中的对象_C#_Windows Phone 7 - Fatal编程技术网

C# 列表<&燃气轮机;WP7本地数据库中的对象

C# 列表<&燃气轮机;WP7本地数据库中的对象,c#,windows-phone-7,C#,Windows Phone 7,如何在WP7本地数据库中存储列表对象?List lcb=myListBox.Items.OfType() List<CheckBox> lcb = myListBox.Items.OfType<CheckBox>() .Where(c => c.IsChecked == true).ToList(); .Where(c=>c.IsChecked==true).ToList(); 我使用了of type而

如何在WP7本地数据库中存储列表对象?

List lcb=myListBox.Items.OfType()
List<CheckBox> lcb = myListBox.Items.OfType<CheckBox>()
                              .Where(c => c.IsChecked == true).ToList();
.Where(c=>c.IsChecked==true).ToList();
我使用了
of type
而不是
Cast
,因为
of type
即使只有一个复选框项或所有项都是复选框,也可以工作


在case to
Cast
中,即使单个项目不是checkbox,也会出现错误。

我有一个带有checkbox项目的列表框。我希望将所有选中的项目添加到列表中并存储在本地数据库中。转到列表框中的每个项目,检查其是否为选中项目。如果选中,则添加到列表中object@stay_hungry检查我的答案。简单的Linq@Matt我正在使用WP7本地数据库
Where(c=>c.IsChecked)
Where(c=>c.Checked)
。@保持饥饿:谢谢编辑。列表显示错误。上面示例中的“c”是什么?@Nikhil Agrawal您能详细解释一下上面的示例吗?