In the XAML template, I used a listbox to populate some dynamic data.
Now I want to disable touch selection in certain listbox items in Windows Phone 7. How to do that ?
I had done some little research, some people said that the selection event could be prevented in the listbox.
http://social.msdn.microsoft.com/forums/en-US/wpf/thread/8eeed347-ede5-4a24-88f1-953acd16e774
Hope some smart guys could teach me how to solve the problem.
Thanks.
Use ItemsControl wrapped in a ScrollViewer. This will give you the same effect without selection (and will allow you to scroll just like a ListBox does)
<ScrollViewer>
<ItemsControl>
<ItemsControl.ItemTemplate>
<DataTemplate>
...
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
You could use the ItemsControl instead of ListBox. ItemsControl is like ListBox, but it comes without the selection stuff.
<ItemsControl>
<ItemsControl.ItemTemplate>
<DataTemplate>
...
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With