1 在window 的设计的时候 ,中间需要进行页面切换的时候,顶一个Frame
<Frame Name=”MainPage” NavigationUIVisibility=”Hidden” Grid.RowSpan=”1″ Grid.Row=”0″ ScrollViewer.CanContentScroll=”False” VerticalAlignment=”Stretch” VerticalContentAlignment=”Top”>
</Frame>
2 页面的跳转
MapPage page = new MapPage(this);
//SystemPage page = new SystemPage(this);
MainPage.Content = page;
3 隐藏系统自带的前进,回退导航
A . xmal 设置
NavigationUIVisibility=”Hidden”
B C#代码设置
MainPage.NavigationUIVisibility = System.Windows.Navigation.NavigationUIVisibility.Hidden;
4 自定义按钮 ,实现前进和后退
void back_btn_click(object sender, MouseEventArgs e)
{
Console.WriteLine(“点了back按钮!”);
if (page.NavigationService.CanGoBack)
{
page.NavigationService.GoBack();
}
}
void next_btn_click(object sender, MouseEventArgs e)
{
Console.WriteLine(“点了next按钮!”);
if (page.NavigationService.CanGoForward)
{
page.NavigationService.GoForward();
}
}
————————————————
版权声明:本文为CSDN博主「rually」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/rually/article/details/47974005