如何在Universal Windows App
中更改默认MainPage.xaml
的位置?我想在Windows和WindowsPhone项目中有一个名为“View”的子文件夹,在这里我保存MainPage.xaml
文件,就像这个例子。在通用应用程序中更改DefaultPage的位置
- Windows项目
- 查看
--- MainPage.xaml中
- WindowsPhone的项目
- 查看
--- MainPagePhone.xaml
- 共享文件
- 型号
- 视图模型
- App.xaml中
有了这个结构我在App.xaml.cs
一个问题,即MainPage
无法找到。
if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
我试过了,但我无法在App.xaml.cs中添加名称空间。它给出了错误:命名空间“视图”不可用 – user2025830
我也试过,它让我只有在Windows Phone和Windows项目中都存在View时才导入命名空间。发布你的项目结构的一些屏幕 –
我做了一个新的项目,现在它的工作。谢谢 – user2025830