// Reloads saved file. private void Load(object sender, RoutedEventArgs e) { SaveClass load = JsonConvert.DeserializeObject <SaveClass>(File.ReadAllText(@"Test\test.json")); name.Text = load.Name; contact.Text = load.Contact; colors.Text = load.Brushcolor; fontSize.Text = load.Fontsize; fonts.Text = load.Font; gradient1.Text = load.gradient1; gradient2.Text = load.gradient2; }
// Saves all selected options for the business card. private void Save(object sender, RoutedEventArgs e) { SaveClass saved = new SaveClass(); { saved.Name = name.Text; saved.Contact = contact.Text; saved.Font = fonts.Text; saved.Fontsize = fontSize.Text; saved.Brushcolor = colors.Text; saved.gradient1 = gradient1.Text; saved.gradient2 = gradient2.Text; } string json = JsonConvert.SerializeObject(saved, Formatting.Indented); File.WriteAllText(@"Test\test.json", json); }