In the setter, you prompt the user and attempt to cancel the selection by discarding the new selected value. The View Model will have the values that you desire, but the UI will look like it applied the changes. Doing this on a separate Dispatcher operation is tolerable, but having to make it look like the value actually took and then undoing it seems like it crosses the line of sanity.
WPF app is built with MVVM such that the combo box’s Selected Item is bound to a property on the View Model. It should detect this and undo the change in the combo box.
In this article I will take you through the various scenarios in which the combobox can be binded to the datasource in MVVM way.
If and only if the binding is done in Two Way mode then the target is able to update the source value (the Text Block is able to update the View Model).The first one is set to Explicit, which basically means that the source won't be updated unless you manually do it. This is more precise and understandable to me to say that a ‘Delay’ property has been added to the Binding markup extension ! I tried letting the underlying value appear to change so that I could change it back to the original value on a Begin Invoke operation. I would think that simply raising Property Changed would tell WPF that to re-query the value. It sort of makes sense once you get it working, but this is definitely not intuitive.
as the control’s new Items Source causes the control to display the revised data and…whoa…clears the currently selected item.