Beispiel #1
0
        public void ScrollToBottom()
        {
            var historyItems = HistoryListView.Items;

            if (historyItems.Count > 0)
            {
                HistoryListView.ScrollIntoView(historyItems[historyItems.Count - 1]);
            }
        }
Beispiel #2
0
        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;
            };
        }