[WPF] Auto Scroll Behavior for ListBox

4
Comments

If you want scroll ListBox to the end automatically when new item added in ItemsSource collection you could use following attached behavior. This approach perfectly suit for MVVM way. ListBoxBehavior.cs: using System.Windows; namespace ListBoxBehavior { /// <summary> /// ListBox AutoScroll attached properties /// </summary> public static class ListBoxBehavior { public static readonly DependencyProperty AutoScrollProperty = DependencyProperty.RegisterAttached( "AutoScroll",...

Read further...