@@ -88,6 +88,8 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
88
88
viewModel = new ItemViewModel ( ) ;
89
89
interactionOperation = new Interaction ( ) ;
90
90
91
+ string NavigationPath = "" ; // path to navigate
92
+
91
93
switch ( NavParams )
92
94
{
93
95
case "Start" :
@@ -99,34 +101,38 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
99
101
SidebarControl . SelectedSidebarItem = App . sideBarItems [ 0 ] ;
100
102
break ;
101
103
case "Desktop" :
102
- ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , App . AppSettings . DesktopPath , new SuppressNavigationTransitionInfo ( ) ) ;
104
+ NavigationPath = App . AppSettings . DesktopPath ;
103
105
SidebarControl . SelectedSidebarItem = App . sideBarItems . First ( x => x . Path . Equals ( App . AppSettings . DesktopPath , StringComparison . OrdinalIgnoreCase ) ) ;
104
106
break ;
105
107
case "Downloads" :
106
- ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , App . AppSettings . DownloadsPath , new SuppressNavigationTransitionInfo ( ) ) ;
108
+ NavigationPath = App . AppSettings . DownloadsPath ;
107
109
SidebarControl . SelectedSidebarItem = App . sideBarItems . First ( x => x . Path . Equals ( App . AppSettings . DownloadsPath , StringComparison . OrdinalIgnoreCase ) ) ;
108
110
break ;
109
111
case "Documents" :
110
- ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , App . AppSettings . DocumentsPath , new SuppressNavigationTransitionInfo ( ) ) ;
112
+ NavigationPath = App . AppSettings . DocumentsPath ;
111
113
SidebarControl . SelectedSidebarItem = App . sideBarItems . First ( x => x . Path . Equals ( App . AppSettings . DocumentsPath , StringComparison . OrdinalIgnoreCase ) ) ;
112
114
break ;
113
115
case "Pictures" :
114
- ItemDisplayFrame . Navigate ( typeof ( PhotoAlbum ) , App . AppSettings . PicturesPath , new SuppressNavigationTransitionInfo ( ) ) ;
116
+ NavigationPath = App . AppSettings . PicturesPath ;
115
117
SidebarControl . SelectedSidebarItem = App . sideBarItems . First ( x => x . Path . Equals ( App . AppSettings . PicturesPath , StringComparison . OrdinalIgnoreCase ) ) ;
116
118
break ;
117
119
case "Music" :
118
- ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , App . AppSettings . MusicPath , new SuppressNavigationTransitionInfo ( ) ) ;
120
+ NavigationPath = App . AppSettings . MusicPath ;
119
121
SidebarControl . SelectedSidebarItem = App . sideBarItems . First ( x => x . Path . Equals ( App . AppSettings . MusicPath , StringComparison . OrdinalIgnoreCase ) ) ;
120
122
break ;
121
123
case "Videos" :
122
- ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , App . AppSettings . VideosPath , new SuppressNavigationTransitionInfo ( ) ) ;
124
+ NavigationPath = App . AppSettings . VideosPath ;
123
125
SidebarControl . SelectedSidebarItem = App . sideBarItems . First ( x => x . Path . Equals ( App . AppSettings . VideosPath , StringComparison . OrdinalIgnoreCase ) ) ;
124
126
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 ;
125
131
126
132
default :
127
133
if ( NavParams [ 0 ] >= 'A' && NavParams [ 0 ] <= 'Z' && NavParams [ 1 ] == ':' )
128
134
{
129
- ItemDisplayFrame . Navigate ( typeof ( GenericFileBrowser ) , NavParams , new SuppressNavigationTransitionInfo ( ) ) ;
135
+ NavigationPath = NavParams ;
130
136
SidebarControl . SelectedSidebarItem = App . AppSettings . DrivesManager . Drives . First ( x => x . Tag . ToString ( ) . Equals ( $ "{ NavParams [ 0 ] } :\\ ", StringComparison . OrdinalIgnoreCase ) ) ;
131
137
}
132
138
else
@@ -136,6 +142,18 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
136
142
break ;
137
143
}
138
144
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
+
139
157
this . Loaded -= Page_Loaded ;
140
158
}
141
159
0 commit comments