无法使用<phone:phoneapplicationpage>

时间:2015-05-06 08:42:49

标签: c# visual-studio xaml windows-phone-8 dll

我正在开发windows phone app for 8.1 我正试图在他们的应用程序中制作像Facebook这样的侧边菜单。 我找到了这个教程:http://sviluppomobile.blogspot.be/2013/08/add-lateral-menus-to-windows-phone.html

现在,当我下载源代码时,我发现xaml使用了<phone:PhoneApplicationPage />

我有这段代码:

<phone:PhoneApplicationPage
    x:Class="Membr2.BlankPage1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="using:Membr2"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

</phone:PhoneApplicationPage>

但它一直给我这两个错误:

 - Unknown type 'PhoneApplicationPage' in XML namespace 'clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone' 
 - The type 'phone:PhoneApplicationPage' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
 - The name "PhoneApplicationPage" does not exist in the namespace "clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone".

我添加了以下参考资料:

  • Microsoft.Phone
  • Microsoft.Phone.Controls.Toolkit

PhoneApplicationPage

中找到Microsoft.Phone

所以我不知道自己做错了什么?我非常了解Windows Phone开发,这些参考文章让我感到疯狂......任何人都可以帮助我更好地理解?

非常感谢提前!!

1 个答案:

答案 0 :(得分:2)

您正在制作Windows Phone 8.1应用程序,<PhoneApplicationPage>是Windows Phone 8 Silver light的一部分。

您应该使用<Page>代替<PhoneApplicationPage>,因为前者用于WinRT