| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- Ensure that you install NuGet into PCL and see Helpers/Settings.cs
- If you are installing this in a normal project and not using a pcl create a new file called Settings.cs or whatever you want and copy this code in:
- // Helpers/Settings.cs
- using Refractored.Xam.Settings;
- using Refractored.Xam.Settings.Abstractions;
- namespace FormsPlayerSample.iOS.Helpers
- {
- /// <summary>
- /// This is the Settings static class that can be used in your Core solution or in any
- /// of your client applications. All settings are laid out the same exact way with getters
- /// and setters.
- /// </summary>
- public static class Settings
- {
- private static ISettings AppSettings
- {
- get
- {
- return CrossSettings.Current;
- }
- }
- #region Setting Constants
- private const string SettingsKey = "settings_key";
- private static readonly string SettingsDefault = string.Empty;
- #endregion
- public static string GeneralSettings
- {
- get
- {
- return AppSettings.GetValueOrDefault(SettingsKey, SettingsDefault);
- }
- set
- {
- AppSettings.AddOrUpdateValue(SettingsKey, value);
- }
- }
- }
- }
|