Open bheemasekharj opened 3 years ago
Implement the Dragablz ClosingTabItemHandlerImpl in your window ViewModel ex:
private static void ClosingTabItemHandlerImpl(ItemActionCallbackArgs
//here's your view model:
var viewModel = args.DragablzItem.DataContext as HeaderedItemViewModel;
System.Diagnostics.Debug.Assert(viewModel != null);
if (....)
//Do something here like prompt the user if they are sure they want to close the tab, checking conditions, etc
else
//here's how you can cancel stuff (cancel the tab from being closed):
//args.Cancel();
}
If all you need to do is check some stuff before closing then you can leave out the if/else and the args.Cancel().
I am using dragablz SetDefaultCloseButton as true. But before closing the tab i want to check some conditions. How to handle close button for tab. I am creating dynamic tab items with some data inside tab control