wp8 导航方法

全局跳转

(App.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/Tools/SpatialQueryChart.xaml", UriKind.Relative));

局部跳转

NavigationService.Navigate(new Uri("/DetailsPage.xaml",Urikind.Relative));

全局跳转2

public void GoBack(int iNumber)

        {

            PhoneApplicationFrame root = (PhoneApplicationFrame)(Application.Current.RootVisual);

            //iNumber表要回退的数量

            if (iNumber >= 0)

            {

                //导航中的条目数

                int iDepth = root.BackStack.Count();

                if (iNumber < iDepth)

                {

                    for (int i = 0; i < iNumber-1; i++)

                    {

                        root.RemoveBackEntry();

                    }

                }

                else

                {

                    for (int i = 0; i < iDepth-1; i++)

                    {

                        root.RemoveBackEntry();

                    }

                }

                if (root.CanGoBack)

                {

                    root.GoBack();

                }

            }

        }

原文地址:https://www.cnblogs.com/luquanmingren/p/3246161.html