Hi,
Required: I want an xml file to be searialized like this
<StudentGroupList>
<Group key = 1>
<StudentItem>
<Name> John </Name>
<GroupName>1</GroupName>
<StudentItem>
<StudentItem>
<Name> David</Name>
<GroupName>1</GroupName>
<StudentItem>
</Group>
<Group key = 2>
<StudentItem>
<Name> Ron</Name>
<GroupName>2</GroupName>
<StudentItem>
</Group>
</StudentGroupList>
Here is the class structure i created to serialize and desreialize
public class StudentItem
{
public string Name {get; set;}
public int GroupName {get; set;}
}
public class StudentGroupList
{
public List<StudentItem> lstStudnetItem = new List<StudentItem>(){get;set;}
int key {get;set;}
}
public class StudentDataSource
{
public List<StudentGroupList> lstStudnetGroup = new List<StudentGroupList>() {get;set;}
public static StudentDataSource objDataSource = new StudentDataSource();
}
i have created single instance of StudentDataSource so that i can use it globally on every page of my windwos 8 aap. i want to use single instance because this instance will desrialize from the xml file above and simultaneously update it as soon as any changes are made. Now as u see i have made this instance as static i can't access the "lstStudnetGroup".
Please provide me a solution of class structure so that i can easily create an aap.
Quote:
please forgive my representation, its the first time i am writing on any blog for help.