基本上,我有两个页面:“MainPage.xaml”和“Workpage.xaml”。我已经创建了一个按钮来从MainPage导航到WorkPage,但它不起作用...这是为什么呢?在我的Windows Phone应用程序中它正常工作...
<Page
x:Class="WindowsApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WindowsApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Button x:Name="btnWorkPage" Content="Button" HorizontalAlignment="Left" Margin="580,304,0,0" VerticalAlignment="Top" Height="74" Width="208" Click="btnWorkPage_Click"/>
</Grid>
Mainpage.xaml.cs:
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private void btnWorkPage_Click(object sender, RoutedEventArgs e)
{
Frame.Navigate(typeof(WorkPage));
}
}
一个简短的演示:http://screencast.com/t/imblOyj5CH ...