【发布时间】:2015-02-07 21:22:14
【问题描述】:
所以,基本上我有 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 ...
【问题讨论】:
-
您还可以分享 WorkPage.xaml 的 xaml 代码吗?您可能正在使用仅适用于 Windows Phone 的静态资源(如样式)
-
我已经添加了解决方案,该死的,这花了我太多时间了 :D
标签: c# xaml windows-store-apps