Windows Phone 8.1 无法识别导航到的页面

Posted

技术标签:

【中文标题】Windows Phone 8.1 无法识别导航到的页面【英文标题】:Windows Phone 8.1 Unable to Recognize the Page Being Navigated to 【发布时间】:2016-01-12 03:19:36 【问题描述】:

在 Windows Phone 8.1 应用程序中,我试图将数据从 MainPage 页面传递到 ImageFullScreen 页面。我从 .shared 文件 (MainPage.cs) 传递数据,但它无法识别 ImageFullScreen 页面。我错过了什么吗?

public class PassedData

    public string Name  get; set; 


private void ListItems_Tapped(object sender, TappedRoutedEventArgs e)

    Frame.Navigate(typeof(ImageFullScreen), new PassedData  Name = "my name");        

错误:

The type or namespace name 'ImageFullScreen' could not be found (are you missing a using directive or an assembly reference?)

【问题讨论】:

右键单击显示 imagefullscreen 的位置,您可以选择导入任何内容吗?我很好奇您的命名空间是否不同。 @Adam Tuliper-MSFT,我没有那个选项... 查看你的 ImageFullScreen,它是同一个命名空间吗?如果是这样,看看这是否有帮助***.com/questions/16516731/… 【参考方案1】:

您必须在页面中添加视图的命名空间(ImageFullScreen)

使用 App1.Views;

在哪里

App1 是您的项目名称

Views 是您放置 ImageFullScreen.xaml 文件的文件夹名称。

如果 ImageFullScreen.xaml 直接在您的项目中创建,请使用

使用 App1;

【讨论】:

以上是关于Windows Phone 8.1 无法识别导航到的页面的主要内容,如果未能解决你的问题,请参考以下文章