I have a list on images in a Pivot control. If you touch an image, it navigates to another view. If if flick through a new pivot and touch the image meanwhile, it navigates.
I noticed the Facebook app or the native photo albums don’t have this bug.
Any idea ?
edit: the code :
Image img = new Image();
Delay.LowProfileImageLoader.SetUriSource(img, new Uri(adViewModel.Photos[k].ThbUrl));
img.Width = 150;
img.Tag = k;
img.Height = 150;
img.MouseLeftButtonDown += new MouseButtonEventHandler(launch_Diapo);
Grid.SetRow(img, i);
Grid.SetColumn(img, j);
PhotosGrid.Children.Add(img);
If you can show your code we can probably provide a more specific answer.
However:
I’m guessing you’re using
MouseButtonLeftDownor similar to detect the touching of the image. Rather than this, use theTapgesture from the toolkit. This should prevent the issue you’re having.There is a possible alternative to disable the pivot gesture while you’re touching the image, but depending on how you’re using the image within the pivotItem this may end up preventing proper pivot navigation.
You can add the
Tapevent in code like this:and the handler would be something like this. (but actually doing something useful-obviously.)