我有一个 Windows phone 8 Silverlight 应用程序,我正在尝试将其转换为 Windows 通用应用程序。我使用了这个网站http://www.mobilize.net/silverlight的免费工具,它有助于过渡,但我遇到了一个奇怪的错误。
我已经搜索了其他帖子,每个人似乎都让这个工作..但这些解决方案对我不起作用......让我解释一下。
我的项目中有很多页面,它们都显示相同的错误,与 App.xaml.cs 页面不同。
这是另一个帖子的链接,其中包含一些解决方案BlankPage 构造函数无法初始化组件
现在我检查了我的 App.xaml 和 MainPage.xaml,根据其他人的解决方案,它们是正确的。
这是 App.xaml 的第一行:
<Application x:Class="StayMobileWP81.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="using:System" xmlns:local="using:StayMobileWP81">
这是 MainPage.xaml 的第一行:
<Page x:Class="StayMobileWP81.Main" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" p2:SystemTray.BackgroundColor="#AF252B" p2:SystemTray.ForegroundColor="White" xmlns:p1="using:Microsoft.Phone.Shell" xmlns:p2="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
我使用命名空间 StayMobileWP81 的两个 .cs 文件。
仍然有这个错误......我试图将 Package.appxmanifest 中的入口点更改为指向“StayMobileWP81.App”,但仍然没有......它目前指向 Main.xaml
我还在另一篇文章中看到,我必须将 Build Action 属性更改为 Page 才能使 InitializeComponet 工作,但就我而言,它们已经在 Main.xaml 中设置为 Page,在 App.xaml 中设置为 ApplicationDefinition。
有谁知道我在这里想念什么?