我正在使用页面和导航服务构建 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'.
我究竟做错了什么?