我的WP8-App使用Xamarin和MvvmCross运行。
当我打开我的应用程序正常然后通过设备上的开始按钮/窗口按钮返回并尝试通过应用程序列表重新打开我的应用程序时,我的应用程序崩溃,出现以下异常:
{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”列表重新加载我的应用程序时(长按我设备上的后退按钮)一切正常,显示最后一页并且不会发生异常。
如果您需要更多信息,请提出要求。谢谢
答案 0 :(得分:0)
我找到了答案(至少对我而言)。请查看以下链接:http://www.codecoding.com/fast-app-switching-and-mvvmcross-how-to-make-it-work/
这解决了我的问题