diff --git a/src/MauiSettings.Example/App.xaml.cs b/src/MauiSettings.Example/App.xaml.cs index 230ea50..4890537 100644 --- a/src/MauiSettings.Example/App.xaml.cs +++ b/src/MauiSettings.Example/App.xaml.cs @@ -5,17 +5,25 @@ namespace MauiSettings.Example { public partial class App : Application { - public static string Hash = "96ug+F5VbYkQjqyolK8SO/R/HHeBZ2srDfMRR7uwrKA="; + //public static string Hash = "96ug+F5VbYkQjqyolK8SO/R/HHeBZ2srDfMRR7uwrKA="; + public static string Hash = "mYGUbR61NUNjIvdEv/veySPxQEWcCRUZ3SZ7TT72IuI="; public App() { InitializeComponent(); // Example of how to generate a new key //string t = EncryptionManager.GenerateBase64Key(); - SettingsApp.LoadSettings(Hash); + //SettingsApp.LoadSettings(); // Needed in order to load only the secure settings (for instance the license) - Dispatcher.DispatchAsync(async() => await SettingsApp.LoadSecureSettingsAsync(Hash)); + //Dispatcher.DispatchAsync(async() => await SettingsApp.LoadSecureSettingsAsync(Hash)); - MainPage = new AppShell(); + // Only Async methods do support encryption! + _ = Task.Run(async () => await SettingsApp.LoadSettingsAsync(Hash)); + /* + Dispatcher.DispatchAsync(async () => + { + await SettingsApp.LoadSettingsAsync(Hash); + });*/ + MainPage = new AppShell(); } protected override void OnSleep() diff --git a/src/MauiSettings.Example/MainPage.xaml b/src/MauiSettings.Example/MainPage.xaml index 69f0ab8..6300da6 100644 --- a/src/MauiSettings.Example/MainPage.xaml +++ b/src/MauiSettings.Example/MainPage.xaml @@ -27,6 +27,12 @@ Command="{Binding SaveSettingsCommand}" HorizontalOptions="Fill" /> +