如何为 Windows 8.1 应用创建设置页面? [英] How to create a settings page for Windows 8.1 apps?

查看:27
本文介绍了如何为 Windows 8.1 应用创建设置页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一篇 MSDN 文章解释了 如何为 Windows Phone 8 创建设置页面.我立即遇到了一个错误,因为 Windows.IO.IsolatedStore 已被弃用或什么的.它不存在.无论如何,我已经习惯了 Windows.Storage.ApplicationData.Current.LocalSettings.

There is a MSDN article that explains how to create a settings page for Windows Phone 8. I immediately ran into an error because Windows.IO.IsolatedStore is deprecated or something. It does not exist. And I got used to Windows.Storage.ApplicationData.Current.LocalSettings anyway.

我想问一下有没有更新的文章.如果没有,我的问题是:这种方法还在使用,还是应该考虑另一种方法?

I want to ask if there is an updated article somewhere. If not, my question is: Is this approach still used, or should I consider another way?

目前我只是这样做:

ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
if (localSettings.Values.Keys.Contains("my_setting") == false)
{
    localSettings.Values["my_setting"] = 1.0;
}

推荐答案

您链接的文章适用于 Windows Phone Silverlight 应用程序(8 和 8.1).有关 Windows 应用商店应用,请参阅快速入门:添加应用设置

The article you link is for Windows Phone Silverlight apps (both 8 and 8.1). For a Windows Store app see Quickstart: Add app settings

Windows Phone 商店应用没有专门的 SettingsFlyout 控件,因此没有页面解释如何使用它.您将做的与在 Silverlight 文档中所做的基本相同,只是您将使用 ApplicationData 设置(您有正确的设置,但请考虑 漫游设置),您将使用 Windows.UI.Xaml 控件而不是 Silverlight 控件来构建您的页面.

There isn't a dedicated SettingsFlyout control for a Windows Phone Store app and so no page explaining how to use it. You'll do essentially the same is you will in Silverlight doc except that you'll save your data with ApplicationData settings (you have that correct, but consider roaming the settings), and you'll use the Windows.UI.Xaml controls instead of the Silverlight controls to build your page.

这篇关于如何为 Windows 8.1 应用创建设置页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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