Inheritance: System.Windows.Controls.UserControl
        public void Initialize(ScrollIntoViewTestControl control)
        {
            // Setup initial conditions.
            control.Width = 300;
            control.Height = 350;

            scrollViewer = control.scrollViewer;
            itemsControl = control.itemsControl;

            // Populate collection.
            PopulateCollection(10);

            // Setup binding.
            control.itemsControl.ItemsSource = items;

            // Setup the scroll-viewer-monitor.
            scrollViewerMonitor = new ScrollViewerMonitor<Placeholder>(scrollViewer);
            scrollViewerMonitor.TopElementChanged += delegate { Debug.WriteLine("!! TopElementChanged: " + scrollViewerMonitor.TopElement.Text); };
        }
 public void Change_Elements_Height(ScrollIntoViewTestControl control)
 {
     foreach (var item in items)
     {
         var element = itemsControl.GetElementFromViewModel<Placeholder>(item);
         element.Height = RandomData.Random.Next(10, 120);
     }
 }
 public void ScrollIntoView__Last_Item(ScrollIntoViewTestControl control)
 {
     scrollViewer.ScrollToTop<Placeholder>(items.Last());
 }
 public void ScrollIntoView__Second_Item(ScrollIntoViewTestControl control)
 {
     scrollViewer.ScrollToTop<Placeholder>(items.ElementAt(1));
 }
 public void Toggle_ScrollViewer__Padding(ScrollIntoViewTestControl control)
 {
     scrollViewer.Padding = scrollViewer.Padding.Left == 0 ? new Thickness(5) : new Thickness(0);
 }
 public void ScrollViewerMonitor__Refresh(ScrollIntoViewTestControl control)
 {
     scrollViewerMonitor.Refresh();
 }
 public void ScrollViewerMonitor__Toggle_IsActive(ScrollIntoViewTestControl control)
 {
     scrollViewerMonitor.IsActive = !scrollViewerMonitor.IsActive;
     Debug.WriteLine("IsActive: " + scrollViewerMonitor.IsActive);
 }