In the Xaml I have
In the code behind, when the close button I prompt the user to save changes (or not), but I want to allow the possibility for the user to cancel the operation
private void ClosingTabItemEx(object source, RoutedEventArgs args)
there seems to be no way to implement this, setting args.Handled=True doesnt work
Hmm .. yes you are right ... probably I cut/pasted the code... wont make that mistake again, thanks.
The Closing event uses a delegate of type EventHandler<TabClosingEventArgs>. When I had VS generate the handler (i.e. in xaml I chose Closing from the intellisense and had it create the handler) it correctly created a method that took TabClosingEventArgs as the e parameter and not RoutedEventArgs. Did you manually create the method or did you use some other method for creating the method?
Ok, it's not totally obvious, but here is how to do it...
{
cancellable.Cancel = true;