I am working on Win 8 app C#. I have one scenario.
I have two scroll viewer . One contain list view and another contain canvas. List view has 25 column and 200 rows. and canvas contain different shapes.
I need to synch both scroll viewer . Both scroll viewer need to move vertically synchronously.
I have tried following things
1)View change event: But this event cause some delay in vertical scrolling. I mean scroll viewer 1 will move then scroll viewer 2 will move.
2)ManupulationDelta and ManupulationMode to handle scrolling manually.
private void ListView_ManipulationDelta_1(object sender, ManipulationDeltaRoutedEventArgs e)
{
double yposition = vsAllRows.VerticalOffset - (e.Delta.Translation.Y);
vsAllRows.ScrollToVerticalOffset(yposition);
}
But this cause perfomrmance issue on ListView control Because scrolling on Listview is not smooth.
3) I cant use this scenario in which i can take one scroll viewer Put grid inside the scroll viewer and list view in one column and canvas in other column due to some other requirement. Please check the sample code.
<ScrollViewer Width="600" Background="Green">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="77*"/>
<ColumnDefinition Width="73*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<Rectangle Height="500" Fill="Red"></Rectangle>
<Rectangle Height="500" Fill="Blue"></Rectangle>
</StackPanel>
<StackPanel Grid.Column="1">
<Rectangle Height="500" Fill="Blue"></Rectangle>
<Rectangle Height="500" Fill="Red"></Rectangle>
</StackPanel>
</Grid>
</ScrollViewer>
Any how i can synch both scroll viewer.
Thanks in Advance Triple G