Skip to content

Commit 1f5562a

Browse files
authored
Fixed a crash that would sometime occur when dragging a tab outside the app (#1941)
1 parent 16f63d6 commit 1f5562a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ private async void TabStrip_TabDroppedOutside(TabView sender, TabViewTabDroppedO
328328
}
329329

330330
var indexOfTabViewItem = sender.TabItems.IndexOf(args.Tab);
331-
var tabViewItemPath = ((((args.Item as TabItem).Content as Grid).Children[0] as Frame).Content as IShellPage).NavigationToolbar.PathControlDisplayText;
331+
var tabViewItemPath = ((((args.Item as TabItem).Content as Grid).Children[0] as Frame).Tag as TabItemContent).NavigationArg;
332332
var selectedTabViewItemIndex = sender.SelectedIndex;
333333
RemoveTab(args.Item as TabItem);
334334
if (!await Interaction.OpenPathInNewWindow(tabViewItemPath))
@@ -338,17 +338,16 @@ private async void TabStrip_TabDroppedOutside(TabView sender, TabViewTabDroppedO
338338
}
339339
}
340340

341-
private async void RemoveTab(TabItem tabItem)
341+
private void RemoveTab(TabItem tabItem)
342342
{
343343
if (Items.Count == 1)
344344
{
345345
MainPage.AppInstances.Remove(tabItem);
346-
await ApplicationView.GetForCurrentView().TryConsolidateAsync();
346+
App.CloseApp();
347347
}
348348
else if (Items.Count > 1)
349349
{
350350
Items.Remove(tabItem);
351-
//App.InteractionViewModel.TabStripSelectedIndex = verticalTabView.SelectedIndex;
352351
}
353352
}
354353
}

0 commit comments

Comments
 (0)