I am building a WPF application using pages and a navigation service.
One of the pages accepts the object as a constructor
Sub New(ByVal o As Object)
' This call is required by the Windows Form Designer.
InitializeComponent()
....
So, to go to it, I do
Dim MyPage As New Page1(MyObject)
MyBase.NavigationService.Navigate(MyPage)
The problem arises when I edit something on the page, and go back, and forward to MyPage the following error occurs:
Cannot create object of type 'Page1'. CreateInstance failed, which can be
caused by not having a public default constructor for 'Page1'.
What am I doing wrong?
source
share