从应用程序列表重新激活时应用程序崩溃

App crashs when re-activating from App-List

我的 WP8-App 使用 Xamarin 和 MvvmCross 运行。

当我正常打开我的应用程序然后通过我设备上的 start-button/windows-button 返回并尝试通过应用程序列表重新打开我的应用程序时,我的应用程序崩溃并出现以下异常:

{Cirrious.CrossCore.Exceptions.MvxException: Unable to find incoming MvxViewModelRequest
   at Cirrious.MvvmCross.WindowsPhone.Views.MvxPhoneViewsContainer.GetRequestFromXamlUri(Uri viewUri)
   at Cirrious.MvvmCross.WindowsPhone.Views.MvxPhoneExtensionMethods.LoadViewModel(IMvxPhoneView phoneView, Uri navigationUri, IMvxBundle savedStateBundle)
   at Cirrious.MvvmCross.WindowsPhone.Views.MvxPhoneExtensionMethods.<>c__DisplayClass1.<OnViewCreate>b__0()
   at Cirrious.MvvmCross.Views.MvxViewExtensionMethods.OnViewCreate(IMvxView view, Func`1 viewModelLoader)
   at Cirrious.MvvmCross.WindowsPhone.Views.MvxPhoneExtensionMethods.OnViewCreate(IMvxPhoneView phoneView, Uri navigationUri, IMvxBundle savedStateBundle)
   at Cirrious.MvvmCross.WindowsPhone.Views.MvxPhonePage.OnNavigatedTo(NavigationEventArgs e)
   at MyApp.MyNamespace.Views.BasePage.OnNavigatedTo(NavigationEventArgs e)
   at Microsoft.Phone.Controls.PhoneApplicationPage.InternalOnNavigatedTo(NavigationEventArgs e)
   at Microsoft.Phone.Controls.PhoneApplicationPage.Microsoft.Phone.Controls.IPhoneApplicationPage.InternalOnNavigatedToX(NavigationEventArgs e)
   at System.Windows.Navigation.NavigationService.RaiseNavigated(Object content, Uri uri, NavigationMode mode, Boolean isNavigationInitiator, IPhoneApplicationPage existingContentPage, IPhoneApplicationPage newContentPage)
   at System.Windows.Navigation.NavigationService.CompleteNavigation(DependencyObject content, NavigationMode mode)
   at System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)}

这发生在每个页面上(也包括只显示一些文本的静态页面)。

当我尝试通过 "last-opened-app" 列表重新加载我的应用程序时(长按我设备上的后退按钮)一切正常,显示最后一页并且没有发生异常。

如果您需要更多信息,请提出要求。谢谢

我找到了答案(至少对我而言)。看看下面的link:http://www.codecoding.com/fast-app-switching-and-mvvmcross-how-to-make-it-work/

这解决了我的问题