简体   繁体   English

Template10在画布上创建后退按钮

[英]Template10 create on canvas back button

How to create on canvas back button for Template10? 如何为Template10在画布上创建后退按钮?

I tried following the example but the back button is not showing. 我尝试按照以下示例进行操作,但后退按钮未显示。 It followed the information here btw: https://github.com/Windows-XAML/Template10/wiki/Controls#navigation (overriding build in behavior section) 它遵循以下信息: https//github.com/Windows-XAML/Template10/wiki/Controls#navigation (覆盖行为中的构建部分)

<Page x:Class="Controls.MainPage"
      xmlns:controls="using:Template10.Controls">
    <controls:PageHeader Frame="{x:Bind Frame}" 
        BackButtonVisibility="Visible"
        Text="Detail" />
</Page>

When I navigate to the second page the back button is not showing. 当我导航到第二页时,后退按钮未显示。 I wonder if I missed something here. 我想知道我是否错过了这里。 I just wanted to show the back button in the canvas instead on the upper left corner in the app title. 我只想在画布上显示后退按钮,而不是在应用程序标题的左上角显示。 Thank you 谢谢

To show the back button in the canvas instead on the upper left corner in the app title, you should be to set Bootstrapper.ShowShellBackButton to false. 要在应用程序标题的左上角而不是在画布上显示后退按钮,应将Bootstrapper.ShowShellBackButton设置为false。 When the shell-drawn back button is visible, the PageHeader's on-canvas back button will not be visible. 当看到外壳绘制的后退按钮时,PageHeader的画布后退按钮将不可见。

If the back button in the canvas does not display, you should be able to check if the PageHeader bind to the context of the navigation stack. 如果画布中的后退按钮未显示,则您应该能够检查PageHeader是否绑定到导航堆栈的上下文。 And if there is no page in the BackStack, the back button does not display. 而且,如果BackStack中没有页面,则不会显示后退按钮。

For more info, please refer the Navigation . 有关更多信息,请参阅导航

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM