WPF ListCtrl滚动到底部

 1 ResultListCtrl.Dispatcher.BeginInvoke(
 2     new Action(() => { 
 3         ResultListCtrl.Items.Add(str);
 4 
 5         if (VisualTreeHelper.GetChildrenCount(ResultListCtrl) > 0)
 6         {
 7             Border border = (Border)VisualTreeHelper.GetChild(ResultListCtrl, 0);
 8             ScrollViewer scrollViewer = (ScrollViewer)VisualTreeHelper.GetChild(border, 0);
 9             scrollViewer.ScrollToBottom();
10         }
11     }),
12     null);
13     Thread.Sleep(200);
14 }   

 

posted @ 2016-07-11 11:32  mymeng_feng  阅读(313)  评论(0编辑  收藏  举报