0

I have a layout where there are two listboxes, I was trying to make them sync and found some tutorials on the net like http://www.software-architects.com/TechnicalArticles/ScrollSync/tabid/101/Default.aspx or Listboxes, scrolling in sync but they dont seem to work under WP7 SDK because there are missing events or properties. Does anybody out there solved the problem of syncing two or more listboxes under windows phone 7?

Thanks in advance

Community
  • 1
  • 1
Sonamor
  • 221
  • 3
  • 16

2 Answers2

0

See my answer in this question: WP7 ScrollViewer programatically scroll a background ScrollViewer in sync with front ScrollViewer

You will be able to keep the scrollviewers in sync, but it may not be smooth, as the WP7 scroll viewer does not have a Scroll event.

To get the ScrollViewer's generated by the ListBox's, use this solution by ColinE WP7 - Scrolling ListBox in external ScrollViewer.

Community
  • 1
  • 1
codechinchilla
  • 2,119
  • 15
  • 22
  • I've read the answer there before but the problem is I cannot use scrollviewers because when the listview is embedded inside a scrollview it doesn't get infinity scroll. So it has to use its own. VerticalOffset property is not available in listview. Any other ideas? Thanks again. – Sonamor Jun 06 '12 at 18:03
  • Give this solution by ColinE a try to get the ScrollViewers generated by the ListBox's http://stackoverflow.com/questions/4611185/wp7-scrolling-listbox-in-external-scrollviewer – codechinchilla Jun 06 '12 at 20:18
0

I came up with a solution using the WarpPanel available from the Silverlight Toolkit for Wp7

  <ListBox Height="350" HorizontalAlignment="Left" Margin="102,72,0,0" Name="lsScore" VerticalAlignment="Top" Width="450" HorizontalContentAlignment="Center">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <toolkit:WrapPanel ItemWidth="220" ItemHeight="50"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>

This solution uses one listbox which is ofc always on sync and in order to seperate the data and align them I use the ItemWidth thats why it has such a high value. If you know any other way to seperate the data without using the ItemWidth property feel free to add an answer. Thanks in advance.

Sonamor
  • 221
  • 3
  • 16