public void LoadFactorSet(string FilePath) { //TODO: Implement error handling in the event a garbage file is selected. if (HasData) { FactorSet.Clear(); ResearchFactors.Clear(); } XmlTextReader reader = new XmlTextReader(FilePath); FactorSet.ReadXml(reader); reader.Close(); foreach (var row in FactorSet.AsEnumerable()) { ResearchFactor factor = new ResearchFactor { Name = row.Field <string>("Name"), Labels = row.Field <ObservableCollection <string> >("Labels"), Levels = row.Field <int>("Levels"), IsWithinSubjects = row.Field <bool>("IsWithinSubjects"), IsRandomized = row.Field <bool>("IsRandomized") }; ResearchFactors.Add(factor); } }