Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个列表框,我在其中动态显示数据库中预先选择的复选框。现在我想遍历它以获取选定的项目/值。我正在使用 mvvm light wpf。
好心建议?
谢谢
如果您使用的是 MVVM,那么您应该将复选框的“IsChecked”值绑定到视图模型中的某个属性。该属性应该可以通过代码访问,您只需要遍历模型集合中的项目。
有关您的特定 ViewModel 的更多信息会很有用。