Q&A #41 – NavigationService Cannot be used in the Constructor of the page.

Did you know that NavigationService cannot be used in constructor of the Windows Phone Page (PhoneApplicationPage).

Q&A #41 – NavigationService Cannot be used in the Constructor of the page.

When attempting to use the NavigationService within the constructor of the page, you will receive the following error.

Q&A #41 - NavigationService Cannot be used in the Constructor of the page.

“An exception of type ‘System.NullReferenceException’ occurred in MobileOSGeek.DLL but was not handled in user code

Additional information: Object reference not set to an instance of an object.”

It is therefore necessary to wait until the Form’s OnNavigatedTo method is called before one uses the NavigationService within the page.

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

No, the forward navigation is currently not supported in Windows Phone 8. Q&A #42 – Is Forward Navigation supported in...
A few months back i had posted a Q&A on the Topic " What it takes to be a Good...
If you are a regular readers of the technical books , Apress is one of the publishers which comes in...