Skip to content

Commit b096f0e

Browse files
committed
Imrpove NavView Selection Indicator for Navigation to and From Removable Disks
1 parent 43a50e0 commit b096f0e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

NavigationSystem.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,16 +407,23 @@ public static void Forward_Click(object sender, RoutedEventArgs e)
407407
}
408408
else
409409
{
410-
GenericFileBrowser.P.path = (History.ForwardList[History.ForwardList.Count() - 1]);
411-
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
410+
Debug.WriteLine("Debug: " + ("Removable Drive (" + History.ForwardList[History.ForwardList.Count() - 1].Split('\\')[0] + "\\)"));
411+
if (!History.ForwardList[History.ForwardList.Count() - 1].Split('\\')[0].Contains("C:\\"))
412412
{
413-
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Name.ToString() == "LocD_IC")
413+
414+
foreach (Microsoft.UI.Xaml.Controls.NavigationViewItemBase NavItemChoice in MainPage.nv.MenuItems)
414415
{
415-
MainPage.Select.itemSelected = NavItemChoice;
416-
break;
416+
if (NavItemChoice is Microsoft.UI.Xaml.Controls.NavigationViewItem && NavItemChoice.Content.ToString() == ("Removable Drive (" + History.ForwardList[History.ForwardList.Count() - 1].Split('\\')[0] + "\\)"))
417+
{
418+
419+
MainPage.Select.itemSelected = NavItemChoice;
420+
break;
421+
}
417422
}
418423
}
424+
GenericFileBrowser.P.path = (History.ForwardList[History.ForwardList.Count() - 1]);
419425
ItemViewModel.ViewModel = new ItemViewModel(History.ForwardList[History.ForwardList.Count() - 1], GenericFileBrowser.GFBPageName); // To take into account the correct index without interference from the folder being navigated to
426+
420427
}
421428

422429

@@ -482,7 +489,6 @@ public static void Refresh_Click(object sender, RoutedEventArgs e)
482489

483490
}
484491

485-
//GenericFileBrowser.P.path = ItemViewModel.PUIP.Path;
486492
}
487493
}
488494

0 commit comments

Comments
 (0)