Windows phone 8 Caliburn Micro-检测休眠或墓碑导航到登录视图

Windows phone 8 Caliburn Micro-检测休眠或墓碑导航到登录视图,windows-phone-8,caliburn.micro,Windows Phone 8,Caliburn.micro,我用的是caliburn micro。在我的应用程序中,我在AppBootStrapper.cs中检测到休眠或墓碑状态 protected override void OnActivate(object sender, ActivatedEventArgs e){} 我会在我的登录页面上“重定向”应用程序(始终) 不可能在AppBootStrapper中使用NavigationService 比如说 protected override void OnActivate(object sende

我用的是caliburn micro。在我的应用程序中,我在AppBootStrapper.cs中检测到休眠或墓碑状态

protected override void OnActivate(object sender, ActivatedEventArgs e){}
我会在我的登录页面上“重定向”应用程序(始终) 不可能在AppBootStrapper中使用NavigationService

比如说

protected override void OnActivate(object sender, ActivatedEventArgs e) 
{
   NavigationService.UriFor<LoginViewModel>().Navigate();
activate上的受保护覆盖无效(对象发送方,ActivatedEventArgs e)
{
NavigationService.UriFor().Navigate();
}


谢谢

如果您使用的是PhoneContainer,则导航服务将在方法RegisterPhoneServices中向该容器注册

container.RegisterPhoneServices(RootFrame);
从那里,您可以从容器请求导航服务并执行导航

var navigationService = container.GetInstance<INavigationService>();
var-navigationService=container.GetInstance();