private double GetListViewOffset() { Point firstViewPosition = SourceWatchControl.TransformToAncestor(GridWithListViews) .Transform(new Point(0, 0)); Point thierdViewPosition = DestinationeWatchControl.TransformToAncestor(GridWithListViews) .Transform(new Point(0, 0)); return(thierdViewPosition.X - firstViewPosition.X); }
public MainWindow() { InitializeComponent(); SourceWatchControl.ItemsSource = Enumerable.Range(1, 10000); NavigateToListViewItemIndex(700); ProjectionWatchControl.ItemsSource = Enumerable.Range(1, 10000); ProjectionWatchControl.SelectedIndex = 2; ProjectionWatchControl.ScrollIntoView(ProjectionWatchControl.SelectedItem); DestinationeWatchControl.ItemsSource = Enumerable.Range(1, 10000); DestinationeWatchControl.SelectedIndex = 999; DestinationeWatchControl.ScrollIntoView(DestinationeWatchControl.SelectedItem); }