【发布时间】:2009-05-13 23:10:26
【问题描述】:
我正在使用页面和导航服务构建 WPF 应用程序。
其中一个页面将对象作为构造函数
Sub New(ByVal o As Object)
' This call is required by the Windows Form Designer.
InitializeComponent()
....
所以,我要导航到它
Dim MyPage As New Page1(MyObject)
MyBase.NavigationService.Navigate(MyPage)
当我在页面中编辑某些内容并返回时出现问题,然后转发到 MyPage 我收到以下错误:
Cannot create object of type 'Page1'. CreateInstance failed, which can be
caused by not having a public default constructor for 'Page1'.
我做错了什么?
【问题讨论】:
标签: wpf navigationservice