private async void tbiSave_Clicked(object sender, EventArgs e) { // Save current app settings await LocalStorageOps.SaveAppSettingsToDB(myAppSettings.GetMyAppState()); await DisplayAlert("App Settings", "App Settings SAVED", "OK"); }
private async Task CheckAppSettings() { // Read Settings myAppSettings.SetMyAppState(await LocalStorageOps.LoadAppSettingsFromDB()); // Check and set App Settings Version if (myAppSettings.AppSettingsVersion == null) { myAppSettings.AppSettingsVersion = APP_SETTINGS_VERSION; AppSettingsVersionChanged = false; } else if (myAppSettings.AppSettingsVersion != APP_SETTINGS_VERSION) { AppSettingsVersionChanged = true; } else { AppSettingsVersionChanged = false; } // Set default values for settings that have changed / added if (AppSettingsVersionChanged) { // Check and set settings that changed int currentVersion = Convert.ToInt32(myAppSettings.AppSettingsVersion.Substring(20)); //switch (currentVersion) //{ // case 3000: // myAppSettings.IsScreenLockingOnTimeoutEnabled = true; // break; // case 3001: // myAppSettings.DelegateeEmailLanguage = "English"; // break; //} myAppSettings.AppSettingsVersion = APP_SETTINGS_VERSION; // Save current app settings await LocalStorageOps.SaveAppSettingsToDB(myAppSettings.GetMyAppState()); } BindingContext = myAppSettings; SetAdvtStatus(); } // end of: CheckAppSettings()