Share via


Preferences Class

Definition

A class to interact with the preferences/settings of the native platform.

public static class Preferences
Inheritance
System.Object
Preferences

Remarks

Each platform uses the platform provided native APIs for storing application/user preferences:

  • iOS: NSUserDefaults:
  • Android: SharedPreferences:
  • UWP: ApplicationDataContainer:

Methods

Clear()

Clears all keys and values.

Clear(String)

Clears all keys and values.

ContainsKey(String, String)

Checks the existence of a given key.

ContainsKey(String)

Checks the existence of a given key.

Get(String, Boolean, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Boolean)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, DateTime, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, DateTime)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Double, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Double)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Int32, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Int32)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Int64, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Int64)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Single, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, Single)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, String, String)

Gets the value for a given key, or the default specified if the key does not exist.

Get(String, String)

Gets the value for a given key, or the default specified if the key does not exist.

Remove(String, String)

Removes a key and its associated value if it exists.

Remove(String)

Removes a key and its associated value if it exists.

Set(String, Boolean, String)

Sets a value for a given key.

Set(String, Boolean)

Sets a value for a given key.

Set(String, DateTime, String)

Sets a value for a given key.

Set(String, DateTime)

Sets a value for a given key.

Set(String, Double, String)

Sets a value for a given key.

Set(String, Double)

Sets a value for a given key.

Set(String, Int32, String)

Sets a value for a given key.

Set(String, Int32)

Sets a value for a given key.

Set(String, Int64, String)

Sets a value for a given key.

Set(String, Int64)

Sets a value for a given key.

Set(String, Single, String)

Sets a value for a given key.

Set(String, Single)

Sets a value for a given key.

Set(String, String, String)

Sets a value for a given key.

Set(String, String)

Sets a value for a given key.

Applies to