Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Latest commit

 

History

History
30 lines (21 loc) · 1.58 KB

GettingStarted.md

File metadata and controls

30 lines (21 loc) · 1.58 KB

Getting Started with the Platform Bindings Framework

Initialisation

In order to be able to use this Framework, you must first call PlatformBindingsBootstrapper.Initialise() at your Application's Startup. This must be inside your App's Project, as it requires the Project's Platform.

To see how to Initialise your Platform, see:

Things to be aware of

Due to AppServices being Initialised after Static Construction, be wary of Static AppSettings Properties, and other Settings Classes that try to access AppServices.Current.IO.LocalSettings or AppServices.Current.IO.RoamingSettings. These will cause an exception if called before AppServices is Initialised for the Platform.

Instead use a static Property with a Getter to construct the Property, only when needed. This should also be better for memory usage, as it allows the Garbage Collector to clean up the Object when finished manipulation. As well as update values when they change from other sources.

Use:

public static AppSetting<bool> ExampleToggleSetting => new AppSetting<bool>();

Instead of:

public static AppSetting<bool> ExampleToggleSetting = new AppSetting<bool>();

While the latter might work, if the Static Property is constructed before AppServices, it will cause an Exception.