I have a SurfaceListBox inside an ScatterViewItem. It feets ok, but the thing is that I would like to move the ScatterviewItem if I don't select any item of the SurfaceListBox.
I've got the following code:
<Grid Background="{StaticResource WindowBackground}" >
<s:ScatterView>
<s:ScatterViewItem >
<Viewbox>
<Grid>
<Grid.RowDefinitions >
<RowDefinition/>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions >
<Label Content="Test" Grid.Row ="0"/>
<s:SurfaceListBox Grid.Row="1" Height="200" >
<s:SurfaceListBoxItem Content ="Test"/>
<s:SurfaceListBoxItem Content ="Test2"/>
<s:SurfaceListBoxItem Content ="Test3"/>
<s:SurfaceListBoxItem Content ="Test4"/>
</s:SurfaceListBox >
<Label Content="Test5" Grid.Row ="2"/>
</Grid>
</Viewbox >
</s:ScatterViewItem >
</s:ScatterView >
</Grid>
If I touch any of the labels the Scatterview responds and I can move it, but if I press over the SurfaceListBox the ScatterView doesn't interact with my finger (even it has an item or not).
What Should I do? I've checked the scatterview events and I don't know wich one use to enable this.
Thanks in advanced,
Pau
Take a step back and think about what you really want to happen... write a series of statements like "when the user puts their finger down on X and moves in Y direction, then Z should happen"
Often times doing this will illustrate that there are some conflicts in what you are trying to do.
If you want the user to be able to put their finger down on a list item and have that movement get translated into selecting the item, scrolling the list, moving the container, or beginning a drag-drop on the item... there's really no way to do all that from the ambiguous input you get from the user. So be very careful that adding some feature doesn't break other features or make your app behave substantially different from other Surface apps.
That said, the technical answer to your question is pretty simple... listen to PreviewContactChanged on the ScatterViewItem. Once you've determined that the contact is moved in the right direction by a reasonable threshold distance, call contact.Capture(scatterViewItem) - this will move 'ownership' of the contact from the listbox to the scatterviewitem which then will use the contact's input to move around.