diff --git a/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs b/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs index 1fb9fe3f46f8..6521bd6990a6 100644 --- a/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs +++ b/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs @@ -328,7 +328,7 @@ private async void TabStrip_TabDroppedOutside(TabView sender, TabViewTabDroppedO } var indexOfTabViewItem = sender.TabItems.IndexOf(args.Tab); - var tabViewItemPath = ((((args.Item as TabItem).Content as Grid).Children[0] as Frame).Content as IShellPage).NavigationToolbar.PathControlDisplayText; + var tabViewItemPath = ((((args.Item as TabItem).Content as Grid).Children[0] as Frame).Tag as TabItemContent).NavigationArg; var selectedTabViewItemIndex = sender.SelectedIndex; RemoveTab(args.Item as TabItem); if (!await Interaction.OpenPathInNewWindow(tabViewItemPath)) @@ -338,17 +338,16 @@ private async void TabStrip_TabDroppedOutside(TabView sender, TabViewTabDroppedO } } - private async void RemoveTab(TabItem tabItem) + private void RemoveTab(TabItem tabItem) { if (Items.Count == 1) { MainPage.AppInstances.Remove(tabItem); - await ApplicationView.GetForCurrentView().TryConsolidateAsync(); + App.CloseApp(); } else if (Items.Count > 1) { Items.Remove(tabItem); - //App.InteractionViewModel.TabStripSelectedIndex = verticalTabView.SelectedIndex; } } }