有没有办法获取WPF工具包自动完成框下拉列表中当前显示的项目数?
答案 0 :(得分:2)
或者你甚至可以这样做并避免循环:
private void AutoCompleteBox_Populated(object sender, PopulatedEventArgs e)
{
int count = ((ReadOnlyCollection<object>)e.Data).Count;
}
答案 1 :(得分:0)
处理Populated
事件:
private void AutoCompleteBox_Populated(object sender, PopulatedEventArgs e)
{
int count = 0;
foreach (var item in e.Data)
count++;
string text = count + " items shown!";
}