繁体   English   中英

Windows应用商店应用frame.navigate()无法正常工作

[英]Windows Store App frame.navigate() not working

所以,基本上我有2个页面:“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 ......

好吧,似乎有一些奇怪的逻辑,你必须删除MainPage并添加一个新的,这里是MS的一些指南

https://msdn.microsoft.com/en-us/library/windows/apps/hh986965.aspx

暂无
暂无

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

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