ButchersBoy / Dragablz

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

Multiple bug fixes & improvements #280

Open BornToBeRoot opened 3 months ago

BornToBeRoot commented 3 months ago

Some improvements & bug fixes

1) Migration to .NET 8 2) Fix #132 - Tabs locked in some cases (this requires a .NET version that supports async) 3) Feature - Use DependencyObject to bind Parition to reuse for e.g. a dragged out window (works if you set it in the constructor)

 <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" Partition="{Binding InterTabPartition }" />

4) Fix - TabEmptiedResponse.DoNothing leaves empty grids when the last tab is closed. To remove them without closing the window, I added TabEmptiedResponse.CloseLayoutBranch.

public TabEmptiedResponse TabEmptiedHandler(TabablzControl tabControl, Window window)
{
    return window is MainWindow ? TabEmptiedResponse.CloseLayoutBranch : TabEmptiedResponse.CloseWindowOrLayoutBranch;
}

5) Feature - Disable branch consolidation for a TabablzControl via DependencyProperty (e.g. if you have a "main" TabablzControl that is responsible for creating new tab items and you don't want this to get destroyed on the last tab that is dragged out)

<dragablz:TabablzControl ClosingItemCallback="{Binding CloseItemCommand}"
                                 ItemsSource="{Binding TabItems}" 
                                 SelectedIndex="{Binding SelectedTabIndex}"
                                 DisableBranchConsolidation="True">
...
</dragablz:TabablzControl

6) Upate MahApps resource keys for brushes/colors.