Frame Image Function Offset
0 coredll.dll xxx_RaiseException 19
1 mscoree3_7.dll 436488
2 mscoree3_7.dll 386545
3 mscoree3_7.dll 540936
4 TransitionStub 0
5 System.Windows.Navigation.NavigationService.Navigate 1652
6 XXX.Components.pushScreen 172
7 XXX.pushHomeScr 996
8 XXX.update 1488
9 .__c__DisplayClass3._ResponseReady_b__0 700
10 mscoree3_7.dll 429164
11 mscoree3_7.dll 185803
12 mscoree3_7.dll 184423
13 System.Reflection.RuntimeMethodInfo.InternalInvoke 112
14 System.Reflection.RuntimeMethodInfo.InternalInvoke 1556
15 System.Reflection.MethodBase.Invoke 104
16 System.Delegate.DynamicInvokeOne 476
17 System.MulticastDelegate.DynamicInvokeImpl 84
18 System.Windows.Threading.DispatcherOperation.Invoke 80
19 System.Windows.Threading.Dispatcher.Dispatch 404
I am using the following code to push new page
Uri navigateUritemp = new Uri(url, UriKind.RelativeOrAbsolute);
if(scrObj.NavigationService.CurrentSource != navigateUritemp)
{
scrObj.NavigationService.Navigate(navigateUritemp);
}
It looks the following line is throwing invalidoperationexception
scrObj.NavigationService.Navigate(navigateUritemp);
can someone tell what is wrong in this code?
One common situation in which I’ve seen this
InvalidOperationExceptionhappen is if multiple navigations are attempted simultaneously, or if a navigation attempt occurs while the app is not in the foreground.This can happen, for example, if a user manages to hit an appbar button a second time while a slow navigation is occurring.
A quick search reveals others have seen the same sort of thing – e.g. http://www.nickharris.net/2011/01/windows-phone-7-navigation-is-not-allowed-when-the-task-is-not-in-the-foreground/