标签: silverlight silverlight-4.0 listbox
我有ListBox的Silverlight 4 SelectionMode="Extended"控件。如何以编程方式从后面的代码中选择多个项目?
ListBox
SelectionMode="Extended"
答案 0 :(得分:3)
foreach (var listBoxItem in listBox.Items.Where(itemsToSelect.Contains)) { listBox.SelectedItems.Add(listBoxItem); }