public void ScrollToBottom() { var historyItems = HistoryListView.Items; if (historyItems.Count > 0) { HistoryListView.ScrollIntoView(historyItems[historyItems.Count - 1]); } }
public HistoryView() { InitializeComponent(); ((INotifyCollectionChanged)HistoryListView.Items).CollectionChanged += (sender, args) => { if (HistoryListView.SelectedIndex != HistoryListView.Items.Count - 2) { return; } var item = HistoryListView.Items[HistoryListView.Items.Count - 1]; HistoryListView.ScrollIntoView(item); HistoryListView.SelectedItem = item; }; }