惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

博客园 - greystar

LightSwitch OOB发布模式下 Title的处理 个性化lightswitch登录屏幕(附源码) LightSwitch登录界面如何设置背景 LightSwitch学习阶段疑难问答 使用 OfficeIntegration.Word 实现lightswitch导出WORD的功能(续) 使用 OfficeIntegration.Word 实现lightswitch导出WORD的功能 lightswitch如何实现文件批量上传功能 lightswitch自定义扩展实现示例教程 devexpress套餐中UploadControl实现自定义参数传递的例子 lightswitch中自动完成框与查询参数的联动效果 如何在LightSwitch中创建多栏自动完成的下拉框 自定义lightswitch主屏幕 SQL Server 2008中的MERGE(不仅仅是合并) 一段XSLT转换XML节点名的测试代码 SL相关的感想 Batch Updating in Entity Framework 利用Register protocol实现网页调用桌面程序 路径标记语法 邮件合并中图片字段的处理
使用LINQ取得已选中的CheckBox
greystar · 2011-02-17 · via 博客园 - greystar

  <toolkit:WrapPanel Name="wrpContainer" >

                   <CheckBox Content="CheckBox1" Height="16" Name="checkBox1" Margin="20" FontSize="14" />
                  <CheckBox Content="CheckBox2" Height="16" Name="checkBox2" Margin="20" FontSize="14" />
                  <CheckBox Content="CheckBox3" Height="16" Name="checkBox3" Margin="20" FontSize="14" />
                  <CheckBox Content="CheckBox4" Height="16" Name="checkBox4" Margin="20" FontSize="14"/>
                  <CheckBox Content="CheckBox6" Height="16" Name="checkBox6" Margin="20" FontSize="14" />
                  <CheckBox Content="CheckBox7" Height="16" Name="checkBox7" Margin="20" FontSize="14" />
                  <CheckBox Content="CheckBox8" Height="16" Name="checkBox8" Margin="20" FontSize="14" />
                  <CheckBox Content="CheckBox9" Height="16" Name="checkBox9" Margin="20" FontSize="14" />
                   <CheckBox Content="CheckBox10" Height="16" Name="checkBox10" Margin="20" FontSize="14" />
</toolkit:WrapPanel>

  var checkedItems = wrpContainer.Children.OfType<CheckBox>().Where( c => c.IsChecked == true );

  MessageBox.Show( string.Format( "有 {0}个选项已选择 " , checkedItems.Count().ToString() ) );

是不是比用循环更加简单!