for (int x = added_signals_listbox.SelectedItems.Count - 1; x >= 0; x--)
{
SignalViewModel SelectedItem = added_signals_listbox.SelectedItems[x] as SignalViewModel;
int SelectedItemIndex = added_signals_listbox.Items.IndexOf(SelectedItem);
//ListBoxItem container = added_signals_listbox.SelectedItems.Item.ContainerFromItem(SelectedItem) as ListBoxItem;
//int SelectedItemIndex = added_signals_listbox.ItemContainerGenerator.IndexFromContainer(container);
_GraphViewerViewModel.AddedSignals.RemoveAt(SelectedItemIndex);
}
注释的代码没有运行,我不记得我昨天试图问什么。对不起这个可怜的问题。我想我一定是复制并粘贴了错误的代码。请关闭问题。