简体   繁体   中英

issue with WPF combobox selectionchanged event

I have my logic of opening a search modal window based on user selection in a combobox. What happens is the modal window opens but the selected item is not reflected in the combobox. ie Unlike a Windows form, the WPF combobox is not reflecting the newly selected item when the selectionchanged event is fired.

well i would have used the SelectionChangeCommitted in a Winform, i am not finding an equivalent in this case. Am i missing something thats obvious? Thanks!

Are you opening the modal window in the context of the selecteditemchanged event of the combo box? I would recommend opening the modal window using the dispatcher. This will give the bindings time to catch up if that is the issue. Are you binding the selected item of the combo box to a property on a model / view model? If so is this a one way or two way bind?

It would help if you posted some code along with your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM