@@ -25,6 +25,8 @@ namespace Files.UserControls
25
25
public sealed partial class HorizontalMultitaskingControl : UserControl , IMultitaskingControl
26
26
{
27
27
private const string TabDropHandledIdentifier = "FilesTabViewItemDropHandled" ;
28
+ private readonly DispatcherTimer tabHoverTimer = new DispatcherTimer ( ) ;
29
+ private TabViewItem hoveredTabViewItem = null ;
28
30
29
31
public const string TabPathIdentifier = "FilesTabViewItemPath" ;
30
32
@@ -33,10 +35,7 @@ public sealed partial class HorizontalMultitaskingControl : UserControl, IMultit
33
35
public void SelectionChanged ( ) => TabStrip_SelectionChanged ( null , null ) ;
34
36
35
37
public ObservableCollection < TabItem > Items => MainPage . AppInstances ;
36
-
37
- private readonly DispatcherTimer tabHoverTimer = new DispatcherTimer ( ) ;
38
- private TabViewItem hoveredTabViewItem = null ;
39
-
38
+
40
39
public HorizontalMultitaskingControl ( )
41
40
{
42
41
this . InitializeComponent ( ) ;
@@ -225,7 +224,7 @@ private void HorizontalTabView_TabItemsChanged(TabView sender, Windows.Foundatio
225
224
break ;
226
225
227
226
case Windows . Foundation . Collections . CollectionChange . ItemInserted :
228
- App . InteractionViewModel . TabStripSelectedIndex = Items . IndexOf ( HorizontalTabView . SelectedItem as TabItem ) ;
227
+ App . InteractionViewModel . TabStripSelectedIndex = ( int ) args . Index ;
229
228
break ;
230
229
}
231
230
}
@@ -279,7 +278,9 @@ private void TabHoverSelected(object sender, object e)
279
278
{
280
279
tabHoverTimer . Stop ( ) ;
281
280
if ( hoveredTabViewItem != null )
281
+ {
282
282
HorizontalTabView . SelectedItem = hoveredTabViewItem ;
283
+ }
283
284
}
284
285
285
286
private void TabStrip_TabDragStarting ( TabView sender , TabViewTabDragStartingEventArgs args )
@@ -298,7 +299,8 @@ private void TabStrip_TabStripDragOver(object sender, DragEventArgs e)
298
299
e . DragUIOverride . Caption = ResourceController . GetTranslation ( "TabStripDragAndDropUIOverrideCaption" ) ;
299
300
e . DragUIOverride . IsCaptionVisible = true ;
300
301
e . DragUIOverride . IsGlyphVisible = false ;
301
- } else
302
+ }
303
+ else
302
304
{
303
305
HorizontalTabView . CanReorderTabs = false ;
304
306
}
0 commit comments