1-我有一个数据类:
public class Data
{
public static List<Employee> Employees = new List<Employee>
{
new Employee {EmployeeID=1, FirstName="Garth", LastName="Schulte", Position="Trainer"},
new Employee {EmployeeID=2, FirstName="James", LastName="Conrad" ,Position="Trainer"}
};
}
2-在MainWindow.xmal.cs
private void GetEmployeeListQuery()
{
dynamic emps = from emp in Data.Employees
select emp;
lbEmployees.DataContext = emps;
}
阅读select emp时出错:
XamlParseException occurred
'在类型'WpfApplication1.MainWindow'上调用与指定绑定约束匹配的构造函数引发异常。行号“3”和行位置“5”。
拜托,告诉我