diff --git a/src/MauiSettings.Example/App.xaml b/src/MauiSettings.Example/App.xaml new file mode 100644 index 0000000..c76d5b4 --- /dev/null +++ b/src/MauiSettings.Example/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/MauiSettings.Example/App.xaml.cs b/src/MauiSettings.Example/App.xaml.cs new file mode 100644 index 0000000..230ea50 --- /dev/null +++ b/src/MauiSettings.Example/App.xaml.cs @@ -0,0 +1,37 @@ +using AndreasReitberger.Shared.Core.Utilities; +using MauiSettings.Example.Models.Settings; + +namespace MauiSettings.Example +{ + public partial class App : Application + { + public static string Hash = "96ug+F5VbYkQjqyolK8SO/R/HHeBZ2srDfMRR7uwrKA="; + public App() + { + InitializeComponent(); + // Example of how to generate a new key + //string t = EncryptionManager.GenerateBase64Key(); + SettingsApp.LoadSettings(Hash); + // Needed in order to load only the secure settings (for instance the license) + Dispatcher.DispatchAsync(async() => await SettingsApp.LoadSecureSettingsAsync(Hash)); + + MainPage = new AppShell(); + } + + protected override void OnSleep() + { + base.OnSleep(); + if (SettingsApp.SettingsChanged) + { + try + { + SettingsApp.SaveSettings(Hash); + } + catch (Exception) + { + + } + } + } + } +} diff --git a/src/MauiSettings.Example/AppShell.xaml b/src/MauiSettings.Example/AppShell.xaml new file mode 100644 index 0000000..8515dd3 --- /dev/null +++ b/src/MauiSettings.Example/AppShell.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/src/MauiSettings.Example/AppShell.xaml.cs b/src/MauiSettings.Example/AppShell.xaml.cs new file mode 100644 index 0000000..48cc4a2 --- /dev/null +++ b/src/MauiSettings.Example/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace MauiSettings.Example +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/src/MauiSettings.Example/MainPage.xaml b/src/MauiSettings.Example/MainPage.xaml new file mode 100644 index 0000000..69f0ab8 --- /dev/null +++ b/src/MauiSettings.Example/MainPage.xaml @@ -0,0 +1,38 @@ + + + + + +