Cancel combobox selection in WPF with MVVM

后端 未结 12 1447
你的背包
你的背包 2020-12-08 10:23

I\'ve got a combobox in my WPF application:



        
12条回答
  •  醉梦人生
    2020-12-08 11:00

    I found a much simpler answer to this question by user shaun on another thread: https://stackoverflow.com/a/6445871/2340705

    The basic problem is that the property changed event gets swallowed. Some would called this a bug. To get around that use BeginInvoke from the Dispatcher to force the property changed event to be put back onto the end of UI event queue. This requires no change to the xaml, no extra behavior classes, and a single line of code changed to the view model.

提交回复
热议问题