Search code examples
c#visual-studiowindows-phone-8navigationimmediate-window

How to navigate to another page in Immediate Window?


I'm trying to navigate to a page with the help of Immediate Window in Visual Studio. I'm using Windows Phone 8.1 Emulators. Normally when writing things like x = 1; etc. does work very well. But when I'm trying to use navigation service,

NavigationService.Navigate(new Uri("/ErrorPage.xaml",UriKind.Relative));

But it does not let me to do so with error message as The expression cannot be evaluated while in run mode.

So I'm wondering if there is any option to let the navigation service work?

Note: The project is in TFS and I cannot check-out the page(neither XAML or code behind), so I have no option to add a temp button to the page.


Solution

  • First: Get the latest Version from TFS by Setting up a local Workspace and choosing "Get Latest". (How are you even able to compile?) Click Me

    Second: If the Immediate Windows says that it can't, it can't. There is no work-around to that. Some things do not work in IW, like Lambda Expressions (but it's finally coming :D !) and NavigationService.

    Addendum: I just googled a bit and there is a VS-Extension on Codeplex called "Extended Immediate Window". Maybe this is going to help you. I don't know it personally.