How to create a settings page for Windows 8.1 apps?

北城以北 提交于 2019-12-24 12:44:00

问题


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?

At the moment I am simply doing this:

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

回答1:


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

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.



来源:https://stackoverflow.com/questions/27070221/how-to-create-a-settings-page-for-windows-8-1-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!