ButchersBoy / Dragablz

Dragable and tearable tab control for WPF
http://dragablz.net
MIT License
2.2k stars 323 forks source link

handling Default close button #277

Open SaryZainoun opened 1 year ago

SaryZainoun commented 1 year ago

Please I just need an example about handling the default close button.

SaryZainoun commented 1 year ago

I have figured it out,

   public Main_Window()
        {
            InitializeComponent();

            main_tabControl.ClosingItemCallback += TabControl_ClosingItemHandler;
        }
       private void TabControl_ClosingItemHandler(ItemActionCallbackArgs<TabablzControl> args)
        {
                if (MessageBox.Show("Sure", "", MessageBoxButton.YesNo, MessageBoxImage.Stop) == MessageBoxResult.No)
                {
                    args.Cancel();
                }
               // or any other needed code
        }