internal async Task Update(Models.Settings settingsData) { settingsData.ConfigVersion = Application.ProductVersion; var storageFs = new IsolatedStorageFileStream(_IsolatedSettingsFile, System.IO.FileMode.Create, _storage); var writer = new StreamWriter(storageFs); var settingsJson = await JsonConvert.SerializeObjectAsync(settingsData); await writer.WriteAsync(settingsJson); writer.Close(); }
private async void btnSaveSettings_Click(object sender, EventArgs e) { var settings = new Models.Settings { TimeBeforeNextAction = (int)timeBeforeNextAction.Value, TapToolsRequired = (int)tapToolsRequired.Value, TapFingersRequired = (int)tapFingersRequired.Value, SwipeToolsRequired = (int)swipeToolsRequired.Value, SwipeFingersRequired = (int)swipeFingersRequired.Value, SpeedRequired = (int)speedRequired.Value, DistanceRequired = (int)distanceRequired.Value, VolumeSpeedIncrease = (int)volumeIncreaseSpeed.Value }; var settingsFile = new LeapifySettings(); await settingsFile.Update(settings); this.Close(); }