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?

https://social.msdn.microsoft.com/forums/vstudio/en-us/d8ac2677-b760-4388-a797-b39db84a7e0f/how-to-cancel-tabcontrolselectionchanged?forum=wpf

seems work subscribing currentchanging event. can cancel tab changing action setting currentchangingeventargs cancel true


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -