开发者

How to navigate EULA and MainPage?

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;
  开发者_StackOverflow中文版      // 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);
    }

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.

Regards, Panache.


Change to <UriMapper:UriMapping Uri="/MainOrEULAPage.xaml"/>

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜