【发布时间】:2015-11-21 09:01:03
【问题描述】:
我为支持 Windows 应用商店的 MvvmCross 应用程序创建了一个新解决方案,并且我想在 Windows 10 上支持 UWP。我已成功迁移 PCL,但使用提供的示例使基本 UWP 应用程序工作时遇到问题MS (NavigationMenu) 使用了他们为新的导航/命令模型推荐的 SplitView 和 AppShell 模式。我参考了一篇有用的博客文章 (http://stephanvs.com/implementing-a-multi-region-presenter-for-windows-10-uwp-and-mvvmcross/),它为我提供了有关如何将 mvvmcross 集成到 AppShell 的一些指导,但是由于 AppShell 没有定义有效的 Frame,因此启动失败。 Frame 是一个只读属性,我一直无法看到它的设置位置。
我正在使用 NavigationMenu 中的标准 AppShell 实现,并按照博文中的建议进行了以下更改:
public sealed partial class AppShell : MvxWindowsPage // was Page
public Frame AppFrame { get { return this.Frame; } } // was this.frame
除了报错后的代码,设置上没有区别。在查看 MvxWindowsPage 实现时,似乎没有什么特别之处,因为它仍然调用 Page 初始化。我有什么明显的遗漏吗?
【问题讨论】:
-
试试这个:Frame currentFrame = (Frame) this.WrappedFrame.UnderlyingControl;