Search Share Home Devices Settings


[#2] WP7Tips: Come faccio a tornare alla pagina corrente del Pivot durante il Tombstoning

(c) Lorenzo Barbieri - 26/09/2010

Questo post è complementare al precedente riguardante il Panorama.

In questo caso è ancora più semplice perchè nel Pivot la proprietà SelectedIndex è read/write Smile:

 

        protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e)
        {
            this.State["Pivot"] = this.pivot.SelectedIndex;
            base.OnNavigatingFrom(e);
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (this.State.ContainsKey("Pivot"))
                this.pivot.SelectedIndex = (int)this.State["Pivot"];
            base.OnNavigatedTo(e);
        }

Tags: WP7 WP7Tips

Comments disabled in this version of the blog.