Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Silverlight组合框SelectionChange在表单_BeginingEdit上触发_C#_Wpf_Silverlight_Combobox_Selectionchanged - Fatal编程技术网

C# Silverlight组合框SelectionChange在表单_BeginingEdit上触发

C# Silverlight组合框SelectionChange在表单_BeginingEdit上触发,c#,wpf,silverlight,combobox,selectionchanged,C#,Wpf,Silverlight,Combobox,Selectionchanged,我想问一下,当我开始编辑表单时,如何禁用combobox selectionchange事件的触发 这里的问题是,当我编辑表单时,selectionchange也会触发,我认为这会导致我的组合框具有空值 请帮忙 谢谢。您可以取消订阅Combobox Selection changed事件,然后从代码隐藏中重新订阅 ComboBox comboBox = new ComboBox(); 订阅SelectedIndexChanged事件 comboBox.SelectedIndexChanged

我想问一下,当我开始编辑表单时,如何禁用combobox selectionchange事件的触发

这里的问题是,当我编辑表单时,selectionchange也会触发,我认为这会导致我的组合框具有空值

请帮忙


谢谢。

您可以取消订阅Combobox Selection changed事件,然后从代码隐藏中重新订阅

ComboBox comboBox = new  ComboBox();
订阅SelectedIndexChanged事件

comboBox.SelectedIndexChanged += comboBox_SelectedIndexChanged;
使用以下代码取消订阅SelectedIndexChanged事件

comboBox.SelectedIndexChanged -= comboBox_SelectedIndexChanged;

您编辑表单的意思是,当您开始在您的组合框中键入文本时?对。我只需单击编辑图标,但我还没有在组合框上更改任何内容。