后退按钮在 XAML/W8 中不起作用 [英] Back button not working in XAML / W8
问题描述
我的页面上有以下按钮:
I have the following button on my page:
<AppBarButton Grid.Column="0" x:Name="backButton" Icon="Back" Margin="10,26,0,-1"
Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
IsEnabled="True"
Visibility="Visible"
Foreground="Green"
AutomationProperties.Name="Back"
AutomationProperties.AutomationId="BackButton"
AutomationProperties.ItemType="Navigation Button" Grid.Row="1" Grid.RowSpan="2" VerticalAlignment="Stretch"
/>
按钮出现,但点击它什么也不做.这被放置在应用程序的两页中的第二页.我按照 NavigatonHelper.cs 中的说明将它连接到我的第二页,但在第一页中没有做任何特别的事情.我错过了什么?
The button appears but clicking it does nothing. This was placed on the second of two pages in the application. I followed the instructions in NavigatonHelper.cs to get it wired up to my second page, but haven't done anything special in the first. What am I missing?
我什至尝试将 Click
属性绑定到自定义函数:
I even tried tying the Click
property to a custom function:
public void ClickGoBack(object sender, RoutedEventArgs routedEventArgs) {
this.Frame.Navigate(typeof(HubPage));
}
但是当我点击按钮时,它甚至从未被击中.
But this never even got hit when I clicked the button.
推荐答案
XAML 中与按钮重叠的顶部网格后面放了一些东西 - 直到现在我才理解自然顺序"的概念.感谢大家的帮助!
Something was put after the top grid in the XAML that overlapped the button - I didn't understand the concept of "natural order" until now. Thanks for the help everyone!
这篇关于后退按钮在 XAML/W8 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!