C# 尿图仪不工作
我正在使用Wp7应用程序。在这里,我使用uriMapper将用户引导到起始页,具体取决于条件 条件是 如果他已经注册,他应该直接转到mypage2.xaml 如果他没有注册,那么他应该转到mypage1.xaml 所以为了解决这个问题,我在app.xaml中使用了UriMapperC# 尿图仪不工作,c#,windows-phone-7,uri,C#,Windows Phone 7,Uri,我正在使用Wp7应用程序。在这里,我使用uriMapper将用户引导到起始页,具体取决于条件 条件是 如果他已经注册,他应该直接转到mypage2.xaml 如果他没有注册,那么他应该转到mypage1.xaml 所以为了解决这个问题,我在app.xaml中使用了UriMapper <uriMapper:UriMapper x:Name="mapper"> <uriMapper:UriMapping Uri="/InermediatePage.xaml"
<uriMapper:UriMapper x:Name="mapper">
<uriMapper:UriMapping Uri="/InermediatePage.xaml" />
</uriMapper:UriMapper>
现在的问题是当我调试。。它很好用
但当我的应用程序被删除并在emulator或设备中重新启动应用程序时
它显示了page.xaml
您没有显示mypage1.xaml或mypage2.xaml,而是查看了App.xaml.cs中激活的事件吗?您可能需要将代码添加到此事件处理程序。您是否查看了App.xaml.cs中激活的事件?您可能需要将代码添加到此事件处理程序
private void LoadActivePage()
{
UriMapper mapper = Resources["mapper"] as UriMapper;
RootFrame.UriMapper = mapper;
if(ifNotRegistered)
{
mapper.UriMappings[0].MappedUri= new Uri("/mypage1.xaml",UriKind.Relative);
}
else
{
mapper.UriMappings[0].MappedUri= new Uri("/mypage2.xaml",UriKind.Relative);
}
}