Skip to content

Commit 17c8b11

Browse files
committed
Fix Side Pane item selection on new tabs and windows
1 parent 6751973 commit 17c8b11

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

Files UWP/ProHome.xaml.cs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -934,34 +934,49 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
934934
if (NavParams == "Start" || NavParams == "New tab")
935935
{
936936
ItemDisplayFrame.Navigate(typeof(YourHome), NavParams, new SuppressNavigationTransitionInfo());
937+
locationsList.SelectedIndex = 0;
937938
}
938939
else if (NavParams == "Desktop")
939940
{
940-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), DesktopPath, new SuppressNavigationTransitionInfo());
941+
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), DesktopPath, new SuppressNavigationTransitionInfo());
942+
locationsList.SelectedIndex = 1;
941943
}
942944
else if (NavParams == "Downloads")
943945
{
944-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), DownloadsPath, new SuppressNavigationTransitionInfo());
946+
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), DownloadsPath, new SuppressNavigationTransitionInfo());
947+
locationsList.SelectedIndex = 2;
945948
}
946949
else if (NavParams == "Documents")
947950
{
948-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), DocumentsPath, new SuppressNavigationTransitionInfo());
951+
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), DocumentsPath, new SuppressNavigationTransitionInfo());
952+
locationsList.SelectedIndex = 3;
949953
}
950954
else if (NavParams == "Pictures" || NavParams == PicturesPath)
951955
{
952-
ItemDisplayFrame.Navigate(typeof(PhotoAlbum), PicturesPath, new SuppressNavigationTransitionInfo());
956+
ItemDisplayFrame.Navigate(typeof(PhotoAlbum), PicturesPath, new SuppressNavigationTransitionInfo());
957+
locationsList.SelectedIndex = 4;
953958
}
954959
else if (NavParams == "Music")
955960
{
956-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), MusicPath, new SuppressNavigationTransitionInfo());
961+
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), MusicPath, new SuppressNavigationTransitionInfo());
962+
locationsList.SelectedIndex = 5;
957963
}
958964
else if (NavParams == "Videos")
959965
{
960966
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), VideosPath, new SuppressNavigationTransitionInfo());
967+
locationsList.SelectedIndex = 6;
961968
}
962969
else
963970
{
964971
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), NavParams, new SuppressNavigationTransitionInfo());
972+
if (NavParams.Contains("C:", StringComparison.OrdinalIgnoreCase))
973+
{
974+
drivesList.SelectedIndex = 0;
975+
}
976+
else
977+
{
978+
drivesList.SelectedItem = null;
979+
}
965980
}
966981
//accessibleContentFrame.Navigate(typeof(YourHome), NavParams, new SuppressNavigationTransitionInfo());
967982
this.Loaded -= Page_Loaded;

0 commit comments

Comments
 (0)