【问题标题】:WP7 Settings to Change Startup PageWP7 设置更改启动页面
【发布时间】:2013-09-11 20:17:19
【问题描述】:

我创建了一个 Lock.xaml 页面,用户在其中插入密码...但我想给用户一个选项来禁用这个锁我已经尝试过 UriMapper

    private void OUriMapper()
    {
        UriMapper mapper = Resources["mapper"] as UriMapper;
        RootFrame.UriMapper = mapper;

        if (.................)
            mapper.UriMappings[0].MappedUri = new Uri("/Lock.xaml?method=UriMapper, UriKind.Relative);
        else
            mapper.UriMappings[0].MappedUri = new Uri("/HomePage.xaml?method=UriMapper, UriKind.Relative);
    }

现在我想要在 Settings.xaml 中创建切换开关,如果切换开关打开,那么用户应该定向到 Lock.xaml 或 HomePage.xaml

我将 UriMapper 代码放在 App.xaml 中

我正在尝试提出一些逻辑来做到这一点,请帮助

【问题讨论】:

    标签: windows-phone-7 windows-phone-8 navigation settings


    【解决方案1】:

    WMAppManifest.xml 中删除NavigationPage 属性。

    然后您可以在 App.xaml.cs 的 Application_Launching 方法中定义用户应通过 NavigationService.Navigate() 定向到哪个页面,具体取决于用户的设置。

    适用于 WP7.8,应该也适用于 WP8。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多