i got this question i don't know is it possible or not. so i am getting this json data
{
"data": {
"student_score": {
"time_elapsed": 10,
"right_moves": 20,
"wrong_moves": 10,
"score": 166
},
"average_score": {
"time_elapsed": 10,
"right_moves": 20,
"wrong_moves": 10,
"score": 166
},
"total_student_count": 1
},
"status": "success",
"time": 1379066567
}
i am able to coveting it to two class objects of these classes..
public class StudentAssignementScoreClassForCompAssn : ViewModelBase
{
private int _time_elapsed;
private int _right_moves;
private int _wrong_moves;
private int _score;
public int time_elasped
{
get
{
return _time_elapsed;
}
set
{
_time_elapsed = value;
RaisePropertyChanged("time_elapsed");
}
}
public int right_moves
{
get
{
return _right_moves;
}
set
{
_right_moves = value;
RaisePropertyChanged("right_moves");
}
}
public int wrong_moves
{
get
{
return _wrong_moves;
}
set
{
_wrong_moves = value;
RaisePropertyChanged("wrong_moves");
}
}
public int score
{
get
{
return _score;
}
set
{
_score = value;
RaisePropertyChanged("score");
}
}
}
second class is same as it is..but with different name.. so my problem is this..the structure of the json data is variable like data fields may be more or less..so is there any way that i automatically create class of this data and can bind all the fields of this class(automatically :))..means data filling and binding with the view that does not depend on how the json coming( i will have separate file for the details of json format) ..i think you are getting my issue..any kind of help like idea or different way of working with json (anything) is appreciated..sorry for my bad english :(