WPF组合框的SelectionChanged事件在不触发,如果它有它相同的项目 [英] SelectionChanged Event of WPF comboBox is not firing if it has same items in it
本文介绍了WPF组合框的SelectionChanged事件在不触发,如果它有它相同的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果使用以下类型的代码,那么WPF组合框的SelectionChanged事件IM不点火
if i m using following type of code then SelectionChanged Event of WPF comboBox is not firing
cmbFunctionsList.Items.Add("sameItem");
cmbFunctionsList.Items.Add("sameItem");
cmbFunctionsList.Items.Add("sameItem");
cmbFunctionsList.Items.Add("sameItem");
cmbFunctionsList.Items.Add("sameItem");
是否有任何工作围绕这一点。
Is there any work around of this.
推荐答案
试着做这样的:
ComboBoxItem newItem = new ComboBoxItem();
newItem.Content = "same item";
cmbFunctionsList.Items.Add(newItem);
从的这里
这篇关于WPF组合框的SelectionChanged事件在不触发,如果它有它相同的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文