Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 尿图仪不工作_C#_Windows Phone 7_Uri - Fatal编程技术网

C# 尿图仪不工作

C# 尿图仪不工作,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"

我正在使用Wp7应用程序。在这里,我使用uriMapper将用户引导到起始页,具体取决于条件

条件是

如果他已经注册,他应该直接转到mypage2.xaml 如果他没有注册,那么他应该转到mypage1.xaml

所以为了解决这个问题,我在app.xaml中使用了UriMapper

    <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);
        }
    }