mirror of
https://github.com/BlossomiShymae/Needlework.Net.git
synced 2025-12-06 10:10:48 +01:00
fix: prevent closing only tab
This commit is contained in:
@@ -13,7 +13,12 @@ public partial class EndpointsTabView : UserControl
|
||||
|
||||
private void TabView_TabCloseRequested(FluentAvalonia.UI.Controls.TabView sender, FluentAvalonia.UI.Controls.TabViewTabCloseRequestedEventArgs args)
|
||||
{
|
||||
if (args.Tab.Content is EndpointItem item)
|
||||
((IList)sender.TabItems).Remove(item);
|
||||
if (args.Tab.Content is EndpointItem item && sender.TabItems is IList tabItems)
|
||||
{
|
||||
if (tabItems.Count > 1)
|
||||
{
|
||||
tabItems.Remove(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user