protected override async void OnNavigatedFrom(NavigationEventArgs e) { //auto-save if game not finished if (!game.isEnd()) { string fullName = UWPIO.SAVEDIR + "\\" + game.getTitle() + game.getAuthor() + ".json"; await UWPIO.createFile(fullName, saveToString(game)); } base.OnNavigatedFrom(e); }
private async void ConfirmationButton_Click(object sender, RoutedEventArgs e) { await UWPIO.createFile(UWPIO.GAMEDIR + "\\" + curFile.Name, fileContents); //do some notification to let the user know it happened ConfirmationButton.IsEnabled = false; ConfirmationButtonText.Text = "Success!"; Regex rgx = new Regex(@"\b\w+\b"); fileContents = rgx.Replace(fileContents, "Success!"); title = "Success!"; author = "Success!"; gamevars = "Success!"; start_state = "Success!"; updateDisplay(); }