private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (storeData)
     {
         TestStorage.WriteXml <ObservableCollection <Student> >(students, "StudentsTest.xml");
     }
 }
        private ObservableCollection <Student> GenerateStudents(int count)
        {
            var listInput = TestStorage.ReadXml <List <InputName> >("InputData.xml");

            male      = (from n in listInput where n.category == "m" select n).ToList();
            female    = (from n in listInput where n.category == "f" select n).ToList();
            lastNames = (from n in listInput where n.category == "l" select n).ToList();
            var list = new ObservableCollection <Student>();

            for (int i = 0; i < count; i++)
            {
                Student student   = new Student();
                int     forGender = rnd.Next(100);
                int     forAge    = rnd.Next(21, 31);
                if (forGender < 25)
                {
                    student = new Student
                    {
                        id        = i,
                        firstName = female[rnd.Next(female.Count)].name,
                        lastName  = lastNames[rnd.Next(lastNames.Count)].name,
                        hobbies   = "the hobbies",
                        isFemale  = true,
                        birthDate = DateTime.Today.AddYears(-forAge)
                    };
                }
                else
                {
                    student = new Student
                    {
                        id        = i,
                        firstName = male[rnd.Next(male.Count)].name,
                        lastName  = lastNames[rnd.Next(lastNames.Count)].name,
                        hobbies   = "the hobbies",
                        isFemale  = false,
                        birthDate = DateTime.Today.AddYears(-forAge)
                    };
                }
                list.Add(student);
                //list.Add(new Student { id = i, firstName = "fname" + i, lastName = $"lname{i}", hobbies = "the hobbies" });
            }

            return(list);
        }