我有这样的课:
class MyClass
{
public int ID{ get; set; }
public string Title{ get; set; }
}
目前我将它绑定到 AutoCompleteBox 像这样:
List<MyClass> lstMyClass = new List<MyClass>();
lstMyClass = context.Sometable;
autoCompleteBox1.ItemsSource = lstMyClass;
autoCompleteBox1.ValueMemberPath = "Title";
autoCompleteBox1.PopulateComplete();
它按标题查找对象,但在自动完成部分它显示类定义而不是项目标题。任何的想法?