如何导航 EULA 和 MainPage? [英] How to navigate EULA and MainPage?

查看:32
本文介绍了如何导航 EULA 和 MainPage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

感谢您的重播.我研究了介绍地方"的概念,但坦率地说,我没有得到那个东西.我是 Windows Phone 7 开发的新手.我将解释我的前辈如何,在我的申请中,我有 EULA 页面,用户必须接受该页面才能使用该应用程序.用户接受 EULA 后,页面将导航到 PhoneNumber.xaml 页面,此处将帖子与电话号码一起发送到门户,现在页面导航到 MainPage.xaml.如果用户是注册用户,则不要显示 EULA 屏幕,只需将 MainPage.xaml 作为应用程序的第一页.现在,像这样使用 UriMapper,

Thanks for your replay. I studied the Introducing the concept of "Places" but frankly speaking i didn't get that thing. I am new to windows phone 7 development so. I will explain how my senior is, in my application i have EULA page which is compulsory to be accepted by the user to use the app. After the EULA is accepted by the user the page is navigated to PhoneNumber.xaml page, here a post is sent to portal along with the phone no., now the page is navigated to MainPage.xaml. And if the user is registered user then don't show the EULA screen just make MainPage.xaml as the first page of the app. Now, using UriMapper like this,

<Application.Resources>
        <UriMapper:UriMapper x:Name="mapper">
            <UriMapper:UriMapping Uri="/MainPage.xaml"/>
        </UriMapper:UriMapper>
    </Application.Resources>

private void SetupUriMapper()
        {
            // Get the UriMapper from the app.xaml resources, and assign it to the root frame
            UriMapper mapper = Resources["mapper"] as UriMapper;
            RootFrame.UriMapper = mapper;
        // Our dummy check -- does the current time have an odd or even number of seconds?
        DateTime time = DateTime.Now;
        int seconds = time.Second;
        bool isOdd = (seconds % 2) == 1;

        // Update the mapper as appropriate
        if (isOdd)
            mapper.UriMappings[0].MappedUri = new Uri("/MainPage.xaml", UriKind.Relative);
        else
            mapper.UriMappings[0].MappedUri = new Uri("/EULA.xaml", UriKind.Relative);
    }

只是为了测试它被设置为DataTime.在这里,问题是当涉及到 EULA.xaml 时,它会导航到 PhoneNumber.xaml,而不是从那里导航到 MainPage.xaml,而是导航到 EULA.xaml.所以这就是问题所在.我们不应该为 EULA 使用弹出窗口,它应该是一个页面.提前感谢您的帮助.

Just for testing it is been set to DataTime. Here, the problem is when it comes to EULA.xaml then it navigates to PhoneNumber.xaml then instead of navigating to MainPage.xaml from there it navigating to EULA.xaml. So this is the problem. We are not suppose to use popup for EULA, it should be a page. Thanks for the help in advance.

问候,华丽.

推荐答案

更改为

并将 WMAppManifest.xml 更改为 <DefaultTask Name ="_default" NavigationPage="MainOrEULAPage.xaml"/>

And change WMAppManifest.xml to <DefaultTask Name ="_default" NavigationPage="MainOrEULAPage.xaml"/>

这篇关于如何导航 EULA 和 MainPage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆