阅读背景:

WPF DataBinding:取消了属性更改 - Combobox未对齐

来源:互联网 

I have a WPF form with a combobox and a textbox (both are databound to an Object's property). Changing the combobox or textbox input updates the Object's property and the databinding kicks in and updates the UI. The problem is, I implemented a way to cancel the change, which works, but screws up the UI updating. If I make the change from the combobox and cancel it, the combobox does not revert the selectedvalue back to what it should be (bound by the object's value). If I make the change from the textbox and cancel it, both the textbox and the combobox show the proper data, but then focus is instantly given to the combobox (when it should've stayed on the textbox since that is the last place I had it). I'm not really sure how to go about fixing this in a general aspect as apposed to handling change events and verifying the change wasn't cancelled afterwards (because then what is the point of databinding?) ...I have a WPF form with a combobox and a textbox




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: