I have a JSON File as below ,
{
"student": {
"fullName": "No Name",
"id": 0001
},
"message": "Lets see if this is displayed!"
}
I want to write some logic in my WPF application where when someone clicks the submit button after filling in the corresoonding text fields those values will be serialized into this JSON.
In the sense for example if someone enters Dwayne as the name , 2222 as the ID and "Hello" as the message I want the JSON file to look as
{
"student": {
"fullName": "Dwayne",
"id": 2222
},
"message": "Hello"
}
Here is what I have implmented thus far in my code behind
I have the StudentData.cs class
public class StudentData
{
public StudentData()
{
}
public string Name { get; set; }
public string ID { get; set; }
public string Message { get; set; }
}
and in the xaml.cs where the save is executed I get the necessary data and save it as an object
string fullName = textName.Text;
string ID = textId.Text;
string message = textMessage.Text;
StudentData stuData = new StudentData();
stuData .Name = fullName;
stuData .ID = ID;
stuData .Message = message;
Can anyone help on what I can do next ?