Skip to content

Commit 53352dc

Browse files
authored
Fixed OneDrive selection in the sidebar (#617)
1 parent 24c5a86 commit 53352dc

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

Files/Strings/es-ES/Resources.resw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,4 +435,7 @@
435435
<data name="SettingsPageHeader.Text" xml:space="preserve">
436436
<value>Ajustes</value>
437437
</data>
438+
<data name="StatusBarControlInvertSelection.Text" xml:space="preserve">
439+
<value>Invertir Selección</value>
440+
</data>
438441
</root>

Files/Views/Pages/ModernShellPage.xaml.cs

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
8888
viewModel = new ItemViewModel();
8989
interactionOperation = new Interaction();
9090

91+
string NavigationPath = ""; // path to navigate
92+
9193
switch (NavParams)
9294
{
9395
case "Start":
@@ -99,34 +101,38 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
99101
SidebarControl.SelectedSidebarItem = App.sideBarItems[0];
100102
break;
101103
case "Desktop":
102-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), App.AppSettings.DesktopPath, new SuppressNavigationTransitionInfo());
104+
NavigationPath = App.AppSettings.DesktopPath;
103105
SidebarControl.SelectedSidebarItem = App.sideBarItems.First(x => x.Path.Equals(App.AppSettings.DesktopPath, StringComparison.OrdinalIgnoreCase));
104106
break;
105107
case "Downloads":
106-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), App.AppSettings.DownloadsPath, new SuppressNavigationTransitionInfo());
108+
NavigationPath = App.AppSettings.DownloadsPath;
107109
SidebarControl.SelectedSidebarItem = App.sideBarItems.First(x => x.Path.Equals(App.AppSettings.DownloadsPath, StringComparison.OrdinalIgnoreCase));
108110
break;
109111
case "Documents":
110-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), App.AppSettings.DocumentsPath, new SuppressNavigationTransitionInfo());
112+
NavigationPath = App.AppSettings.DocumentsPath;
111113
SidebarControl.SelectedSidebarItem = App.sideBarItems.First(x => x.Path.Equals(App.AppSettings.DocumentsPath, StringComparison.OrdinalIgnoreCase));
112114
break;
113115
case "Pictures":
114-
ItemDisplayFrame.Navigate(typeof(PhotoAlbum), App.AppSettings.PicturesPath, new SuppressNavigationTransitionInfo());
116+
NavigationPath = App.AppSettings.PicturesPath;
115117
SidebarControl.SelectedSidebarItem = App.sideBarItems.First(x => x.Path.Equals(App.AppSettings.PicturesPath, StringComparison.OrdinalIgnoreCase));
116118
break;
117119
case "Music":
118-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), App.AppSettings.MusicPath, new SuppressNavigationTransitionInfo());
120+
NavigationPath = App.AppSettings.MusicPath;
119121
SidebarControl.SelectedSidebarItem = App.sideBarItems.First(x => x.Path.Equals(App.AppSettings.MusicPath, StringComparison.OrdinalIgnoreCase));
120122
break;
121123
case "Videos":
122-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), App.AppSettings.VideosPath, new SuppressNavigationTransitionInfo());
124+
NavigationPath = App.AppSettings.VideosPath;
123125
SidebarControl.SelectedSidebarItem = App.sideBarItems.First(x => x.Path.Equals(App.AppSettings.VideosPath, StringComparison.OrdinalIgnoreCase));
124126
break;
127+
case "OneDrive":
128+
NavigationPath = App.AppSettings.OneDrivePath;
129+
SidebarControl.SelectedSidebarItem = App.sideBarItems.First(x => x.Path.Equals(App.AppSettings.OneDrivePath, StringComparison.OrdinalIgnoreCase));
130+
break;
125131

126132
default:
127133
if (NavParams[0] >= 'A' && NavParams[0] <= 'Z' && NavParams[1] == ':')
128134
{
129-
ItemDisplayFrame.Navigate(typeof(GenericFileBrowser), NavParams, new SuppressNavigationTransitionInfo());
135+
NavigationPath = NavParams;
130136
SidebarControl.SelectedSidebarItem = App.AppSettings.DrivesManager.Drives.First(x => x.Tag.ToString().Equals($"{NavParams[0]}:\\", StringComparison.OrdinalIgnoreCase));
131137
}
132138
else
@@ -136,6 +142,18 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
136142
break;
137143
}
138144

145+
if (NavigationPath != "" )
146+
{
147+
if (App.AppSettings.LayoutMode == 0) // List View
148+
{
149+
App.CurrentInstance.ContentFrame.Navigate(typeof(GenericFileBrowser), NavigationPath, new SuppressNavigationTransitionInfo());
150+
}
151+
else
152+
{
153+
App.CurrentInstance.ContentFrame.Navigate(typeof(PhotoAlbum), NavigationPath, new SuppressNavigationTransitionInfo());
154+
}
155+
}
156+
139157
this.Loaded -= Page_Loaded;
140158
}
141159

0 commit comments

Comments
 (0)