UWP:在两个页面之间实现基本导航会导致错误
UWP: Implementing basic navigation between two pages results in an error?
,所以我来自Windows表单,我正在尝试在Visual Studio 2017中创建一个UWP(通用Windows程序),用于运行Windows IoT的Raspberry Pi。我需要弄清楚如何使用程序创建多个窗口,因此我遵循Microsoft的本教程到TEE:https://learn.microsoft.com/en-us/windows/uwindows/UWP/uwp/design/basics/navigate-bettion - 两页。从理论上讲,它应该很好地编译,但这一切都返回:
Error C2065 'Page2': undeclared identifier (page1.xaml.cpp)
Error C2653 'Page2': is not a class or namespace name (page1.xaml.cpp)
Error C2065 'Page1': undeclared identifier (page2.xaml.cpp)
Error C2065 'Page1': undeclared identifier NavApp1 (app.xaml.cpp)
Error C2653 'Page1': is not a class or namespace name (page2.xaml.cpp)
Error C2653 'Page1': is not a class or namespace name (app.xaml.cpp)
我的代码:( page1.xaml.cpp):
#include "Page2.xaml.h" #include "pch.h" #include "Page1.xaml.h"
void NavApp1::Page1::HyperlinkButton_Click(Platform::Object^ sender,
Windows::UI::Xaml::RoutedEventArgs^ e)
{ this->Frame->Navigate(Windows::UI::Xaml::Interop::TypeName(Page2::typeid)); }
我的代码:( page2.xaml.cpp):
#include "Page1.xaml.h" #include "pch.h" #include "Page2.xaml.h"
void NavApp1::Page2::HyperlinkButton_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{this->Frame->Navigate(Windows::UI::Xaml::Interop::TypeName(Page1::typeid));}
答案:我能够通过放置
来解决此问题#include "Page1.xaml.h"
#include "Page2.xaml.h"
在#include pch.h
相关文章:
- 如果没有malloc,链表实现将失败
- 如何在c++中实现处理器调度模拟器
- 如何在c++中使用引用实现类似python的行为
- 实现无开销push_back的最佳方法是什么
- 使用简单类型列表实现的指数编译时间.为什么
- 如何在BST的这个简单递归实现中消除警告
- 实现一个在集合上迭代的模板函数
- 我应该实现右值推送功能吗?我应该使用std::move吗
- 如何正确实现和访问运算符的各种自定义枚举器
- C++Union/Struct位域的实现和可移植性
- 这个极客对极客的trie实现是否存在内存泄漏问题
- 在c++中实现LinkedList时,应出现未处理的错误
- 为左值和右值的包装器实现C++范围
- 使用模板进行堆栈实现; "name followed by :: must be a class or namespace"
- 使用GSoap实现ONVIF
- 在用于格式4的arm模拟器中实现功能时的一个问题
- 用于AVX的ln(x)的实现,m256
- 用常见虚拟函数实现的任意组合来实现派生类的正确方法是什么
- UWP:在两个页面之间实现基本导航会导致错误
- Qt-关于如何在UI窗体之间实现导航的任何指南