I'm attempting to port some logic on tab change that will do a pretty standard check for dirty state, successive save, etc. I've attempted to do something with the PreviewSelectionChanged but this seems problematic. At the point when this event fires it is already assumed that the newly selected tab is the currently selected tab which interferes with the logic I'm trying to execute. What I really need is a chance to register the fact that the selection is being requested but to capture the relevant data, cancel the operation, then substitute our own logic. The other complication here is that since the overall save logic is bound to be asynchronous, there's no real way to keep the tabcontrol waiting on my input as to whether it should change tabs, hence the desire to just cancel the action altogether then be able to change tabs later manually.
Any hacks/suggestions here?