Wednesday, 11 September 2013

WP8 Listbox still scrolling after ScrollViewer has been disabled

WP8 Listbox still scrolling after ScrollViewer has been disabled

I want a Listbox to be not scrollable. Disabling the Scrollviewer's
ScrollbarVisibility doesn't work properly.
I can't provide an SSCCE, since this is a WP8 project. However, create a
new WP8 project, then copy this to MainPage.xaml inside the Grid named
"ContentPanel"
<ListBox x:Name="list" ScrollViewer.VerticalScrollBarVisibility="Disabled" />
And copy this to MainPage.xaml.cs below InitializeComponent();:
List<string> testList=new List<string>();
for(int i=0;i<50;i++)
{
testList.Add("Some text with a number "+i);
}
this.list.ItemsSource=testList;
Now deploy the app.
You cannot scroll the Listbox, when you move your finger along the y-axis.
However, when you move your finger diagonal across the screen, it will
still scroll. How can I avoid this scrolling. I don't want any scrolling
at all.
Thanks

No comments:

Post a Comment