如何在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