private void OnReachBottom() { if (ReachBottom != null) { ReachBottom.Invoke(); } }
private void listBox_VerticalScrollBar_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { ScrollBar sb = sender as ScrollBar; if (sb.Value >= sb.Maximum - 50) { if (DateTime.Now - lastRaiseTime < TimeSpan.FromSeconds(2)) { return; } ReachBottom?.Invoke(this, new EventArgs()); lastRaiseTime = DateTime.Now; } }