... so resulting event handlers can be executed asynchronously. That way a viewModel could contain method signatures like Task TryCloseTabAsync and do non blocking calls and set the close args onec the async call is done.
The current state is very annoying if you try to delegate close permission handling to the viewModel, since you have to do a blocking call on the viewModel of a tab in the event handler before setting the args to Canceled.
As long as this feature is not integrated here, you may try using Dragablz. I think they support what you want and they integrate with MahApps. https://github.com/ButchersBoy/Dragablz
Is your feature request related to a problem? Please describe. I ran into the same issue as the OP in #2302
While i did find a workaround to link up TabItems in a mvvm friendly way, getting a solution which is async+await friendly is more of an issue.
Describe the solution you'd like Ideally https://github.com/MahApps/MahApps.Metro/blob/71d455826f77d37ad0aa33a922e2b5394406fa52/src/MahApps.Metro/Controls/MetroTabControl.cs#L88 would be
public delegate Task ...
... so resulting event handlers can be executed asynchronously. That way a viewModel could contain method signatures like
Task TryCloseTabAsync
and do non blocking calls and set the close args onec the async call is done.The current state is very annoying if you try to delegate close permission handling to the viewModel, since you have to do a blocking call on the viewModel of a tab in the event handler before setting the args to Canceled.
Closed Issues
2302