Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aritchie/settings
A cross platform settings plugin for Xamarin and Windows. Unlike other setting libraries in the wild, this library provides several unique features. Store almost any object, monitor change events, iOS app groups, iCloud Provider, and Old school windows settings
https://github.com/aritchie/settings
Last synced: 3 months ago
JSON representation
A cross platform settings plugin for Xamarin and Windows. Unlike other setting libraries in the wild, this library provides several unique features. Store almost any object, monitor change events, iOS app groups, iCloud Provider, and Old school windows settings
- Host: GitHub
- URL: https://github.com/aritchie/settings
- Owner: aritchie
- License: mit
- Archived: true
- Created: 2015-01-07T13:11:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-12T15:39:07.000Z (over 5 years ago)
- Last Synced: 2024-07-31T00:05:16.261Z (3 months ago)
- Language: C#
- Homepage:
- Size: 8.83 MB
- Stars: 71
- Watchers: 8
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-xamarin - Settings ★58 - Cross platform settings plugin for Xamarin and Windows. (Database)
README
# UPDATE - This library has now moved to the Shiny Framework at https://github.com/shinyorg/shiny
## ACR Settings Plugin for Xamarin and Windows
A cross platform settings plugin for Xamarin and Windows. Unlike other setting libraries in the wild, this library provides several unique features### [SUPPORT THIS PROJECT](https://github.com/aritchie/home)
[Change Log - April 12, 2018](changelog.md)
[![NuGet](https://img.shields.io/nuget/v/Acr.Settings.svg?maxAge=2592000)](https://www.nuget.org/packages/Acr.Settings/)
[![Build status](https://dev.azure.com/allanritchie/Plugins/_apis/build/status/Settings)](https://dev.azure.com/allanritchie/Plugins/_build/latest?definitionId=11)## Features
* You can store/retrieve just about any type of object (thanks to Newtonsoft.Json)
* You can monitor for changes using the Changed event
* iCloud Settings Provider
* You can use roaming profiles which is useful for:
* iOS app groups
* iOS extensions
* iWatch
* Android Wear## To use, simply call:
var int1 = CrossSettings.Current.Get("Key");
var int2 = CrossSettings.Current.Get("Key");CrossSettings.Current.Set("Key", AnyObject); // converts to JSON
var obj = CrossSettings.Current.Get("Key");## Strongly Typed Binding (works with all platforms - no fancy reflection that breaks on iOS)
var myInpcObj = CrossSettings.Current.Bind(); // Your object must implement INotifyPropertyChanged
myInpcObj.SomeProperty = "Hi"; // everything is automatically synchronized to settings right here//From your viewmodel
CrossSettings.Current.Bind(this);// make sure to unbind when your model is done
CrossSettings.Current.UnBind(obj);## To supply your own implementation:
CrossSettings.Current = new YourImplementationInheritingISettings();
## Monitor setting changes:
CrossSettings.Current.Changed += (sender, args) => {
Console.WriteLine(args.Action);
Console.WriteLine(args.Key);
Console.WriteLine(args.Value);
};### Dependency Injection:
*Autofac*
containerBuilder.Register(x => CrossSettings.Current).As().SingleInstance();
OR for strongly typedcontainerBuilder.Register(_ => CrossSettings.Current.Bind()).AsSelf().SingleInstance();