c# - WPF Validate/Setter calls in wrong order -
i have textbox inside tabcontrol. textbox binding has updatesourcetrigger=lostfocus. textbox uses attribute based validation data model. validation working correctly.
in tabcontrol.selecteditemchanged event call modelobject.validate() , prevent switch different tab if error occurs. problem have order of execution backwards. validate call occurs before property setter. in case of invalid field able switch away tab though error has been detected.
how order or these events ordered properly?
is there way cancel tabcontrol.items.currentchanging?
seems work subscribing currentchanging event. can cancel tab changing action setting currentchangingeventargs cancel true
Comments
Post a Comment