从可观察集合中获取特定项的索引-UWP c#

从可观察集合中获取特定项的索引-UWP c#,c#,uwp,observablecollection,C#,Uwp,Observablecollection,我想从我的可观察集合中获取特定项的索引。我有一个像下面这样的班级 namespace TestClass { public class ClassRoomList { public int ClassID{ get; set; } public ObservableCollection<CurrentStudentsList> CurrentStudentsArray { get; set; } } public class CurrentStudentsList { public

我想从我的可观察集合中获取特定项的索引。我有一个像下面这样的班级

namespace TestClass
{
public class ClassRoomList
{
public int ClassID{ get; set; }
public ObservableCollection<CurrentStudentsList> CurrentStudentsArray { get; set; }
}

public class CurrentStudentsList
{
public string StudentName { get; set; }
public string StudentID { get; set; }
public ObservableCollection<StudentsMarksList> StudentsMarksArray { get; set;            }

}
public class StudentsMarksList
{
public string MarkInEnglish { get; set; }
public string MarkInMaths{ get; set; }
}
名称空间测试类
{
公共班级教室名单
{
public int ClassID{get;set;}
公共可观测集合CurrentStudentsArray{get;set;}
}
公共班级学生名单
{
公共字符串StudentName{get;set;}
公共字符串StudentID{get;set;}
公共ObservableCollection StudentsMarksArray{get;set;}
}
公共班级学生成绩表
{
公共字符串MarkInEnglish{get;set;}
公共字符串MarkInMaths{get;set;}
}
我的可观测集合定义为

 public static ObservableCollection<ClassRoomList> _ClassRoomList = new ObservableCollection<ClassRoomList>();
publicstaticobservedcollection\u ClassRoomList=newobservedcollection();

如何获取StudentsMarksArray的索引,其中StudentID=555?

您是否尝试过
CurrentStudentsArray.FirstOrDefault(s=>s.StudentID==555)
然后是对象的
索引of
?您的“StudentsMarkArray索引”是什么意思?它是当前StudentsList中的一个属性,因此没有索引