当应用程序在 Windows Phone 7 中启动时如何显示不同的页面? [英] How to show different pages when app launches time in windows phone 7?

查看:25
本文介绍了当应用程序在 Windows Phone 7 中启动时如何显示不同的页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当应用程序启动时需要显示注册页面.一旦用户注册它不应该去注册页面需要去登录页面.如何实现这一目标?

When app launches time need to show the registration page.once user registered it shouldn't goes to registration page need to go log in page. How to achieve this?

推荐答案

您可以从代码导航到 Windows Phone 应用的起始页.

You can navigate to the start page of a Windows Phone app from code.

从 WMAppManifest 中删除DefaultTask"条目

从 WMAppManifest 中的DefaultTask"中删除 NavigationPage 属性,并在您的应用程序的 Launching 事件中使用类似于下面示例的内容在启动时导航到选择的页面.

Remove the NavigationPage attribute from the "DefaultTask" in WMAppManifest, and in the Launching event of your app use the something like the example below to navigate to the page of choice upon launch.

    private void Application_Launching(object sender, LaunchingEventArgs e)
    {
        if (registered)
        {
           ((App)Application.Current).RootFrame.Navigate(new Uri("/<your start page>.xaml", UriKind.Relative));
        }
        else
        {
           ((App)Application.Current).RootFrame.Navigate(new Uri("/<your registration page>.xaml", UriKind.Relative));
        }

    }

您只需要决定如何确定某人已经注册.

You just have to decide how you want to determine that someone already registered.

这篇关于当应用程序在 Windows Phone 7 中启动时如何显示不同的页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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