Hey guys, I want to move the listbox scrollbar to the bottom whenever a new item is added to the itemssource, but ScrollIntoView() doesn't seem to do anything if I pass it either a reference to the newly added item, or the index of it. Has anyone gotten this to work, or have any other suggestions as to how I could scroll the listbox down to the bottom?
Some code:
void Actions_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
//if a new item was added, set it to the selected item
if (e.NewItems != null)
{
MainListBox.SelectedIndex = e.NewStartingIndex;
//MainListBox.ScrollIntoView(MainListBox.Items.Last()); //todo: this doesnt seem to work
}
}