i want to ask how to permanently save user input data read in through different TextBox
es and only temporary saved in a DataGrid
(Data get lost after closing the application).
I do not want to use SQL for this application. I just want to store the user input data constantly even if closing VS2017.
Is there a commando to make it possible?
Code As Requested:
namespace New_Adress_Book
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
dg.ItemsSource = personen;
}
List<Person> personen = new List<Person>();
private void Button_Speichern(object sender, RoutedEventArgs e)
{
personen.Add(new Person(Vorname.Text, Nachname.Text, Strasse.Text, Hausnummer.Text, Ort.Text, TelNr.Text));
dg.Items.Refresh();
}
}
class Person
{
public Person (string vn, string nn, string str, string hnr, string ort, string telnr)
{
this.Vorname = vn;
this.Nachname = nn;
this.Strasse = str;
this.Hausnummer = hnr;
this.Ort = ort;
this.Telefonnummer = telnr;
}
// Something seems to be missing here...
public string Vorname
{
get;
set;
}
public string Nachname
{
get;
set;
} ...
}
}
Sorry for any grammatical mistakes you will find and sorry for any offense against the Forum rules. I am really new to this!