Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
Cancelling the closing event
posted

 In the Xaml I have

<igWindows:XamTabControl ShowTabHeaderCloseButton="True"
TabItemCloseButtonVisibility="WhenSelectedOrHotTracked" 
 igWindows:TabItemEx.Closing="ClosingTabItemEx">

 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

Parents
No Data
Reply
  • 75
    posted

    Ok, it's not totally obvious, but here is how to do it... 

    private void ClosingTabItemEx(object source, RoutedEventArgs args)

    {

    CancelableRoutedEventArgs cancellable = args as CancelableRoutedEventArgs;

    cancellable.Cancel = true;

    }

     

Children