Programmatically go to the next Panorama item

Is it possible to programmatically navigate from one panoramic page / element to the next and get the same animated sliding effect that you get when you slide your finger?

I can use the PanoramaControl.DefaultItem property to go to the expected element / page, but you will not get an animated slide effect. Any ideas here?

+5
source share
5 answers

Cannot change the selected panorama index. As you noted, the only way to set the index is to use the DefaultItem property, which is useful only when navigating a page containing a panorama.

- , .

+1

, DefaultItem Completed Completed :

public static class PanoramaExtensions
{
    public static void SlideToPage(this Panorama self, int item)
    {

        var slide_transition = new SlideTransition() { };
        slide_transition.Mode = SlideTransitionMode.SlideLeftFadeIn;
        ITransition transition = slide_transition.GetTransition(self);
        transition.Completed += delegate
        {
            self.DefaultItem = self.Items[item];
            transition.Stop();
        };
        transition.Begin();
    }
}

my_panorama.SlideToPage(1) .

+13

:

panoramaRoot.DefaultItem = (PanoramaItem)panoramaRoot.Items[1];
+6

, - - . VisualStateManager.GoToState(<page>, <state>, true);, .

+1

- , .

If you need such an experience, you can try the manual panorama - for example, http://phone.codeplex.com/

+1
source

All Articles