1
我想滾動根據其選擇放置在srollviewer內的列表框。如何從列表框中獲取列表框項目wpf
ListBoxItem item = (ListBoxItem)(lbTrack.ItemContainerGenerator.ContainerFromItem(lbTrack.Items.CurrentItem));
// ListBoxItem item = (ListBoxItem)(lbTrack.ItemContainerGenerator.ContainerFromItem(lbTrack.SelectedItem));
if (item != null)
{
item.BringIntoView();
}
但它給予空值。