@@ -37,7 +37,7 @@ public sealed partial class YourHome : Page
3737 public YourHome ( )
3838 {
3939 InitializeComponent ( ) ;
40- GetCurrentSelectedTabInstance < ProHome > ( ) . PathText . Text = "Favorites" ;
40+ App . selectedTabInstance . PathText . Text = "Favorites" ;
4141
4242 // Overwrite paths for common locations if Custom Locations setting is enabled
4343 ApplicationDataContainer localSettings = ApplicationData . Current . LocalSettings ;
@@ -82,16 +82,16 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
8282 Frame rootFrame = Window . Current . Content as Frame ;
8383 var instanceTabsView = rootFrame . Content as InstanceTabsView ;
8484 instanceTabsView . SetSelectedTabInfo ( "Favorites" , null ) ;
85- GetCurrentSelectedTabInstance < ProHome > ( ) . BackButton . IsEnabled = GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . CanGoBack ;
86- GetCurrentSelectedTabInstance < ProHome > ( ) . ForwardButton . IsEnabled = GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . CanGoForward ;
87- GetCurrentSelectedTabInstance < ProHome > ( ) . RefreshButton . IsEnabled = false ;
88- GetCurrentSelectedTabInstance < ProHome > ( ) . accessiblePasteButton . IsEnabled = false ;
89- GetCurrentSelectedTabInstance < ProHome > ( ) . AlwaysPresentCommands . isEnabled = false ;
90- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = false ;
85+ App . selectedTabInstance . BackButton . IsEnabled = App . selectedTabInstance . accessibleContentFrame . CanGoBack ;
86+ App . selectedTabInstance . ForwardButton . IsEnabled = App . selectedTabInstance . accessibleContentFrame . CanGoForward ;
87+ App . selectedTabInstance . RefreshButton . IsEnabled = false ;
88+ App . selectedTabInstance . accessiblePasteButton . IsEnabled = false ;
89+ App . selectedTabInstance . AlwaysPresentCommands . isEnabled = false ;
90+ App . selectedTabInstance . LayoutItems . isEnabled = false ;
9191
9292 // Clear the path UI and replace with Favorites
93- GetCurrentSelectedTabInstance < ProHome > ( ) . pathBoxItems . Clear ( ) ;
94- //Style tabStyleFixed = GetCurrentSelectedTabInstance<ProHome>() .accessiblePathTabView.Resources["PathSectionTabStyle"] as Style;
93+ App . selectedTabInstance . pathBoxItems . Clear ( ) ;
94+ //Style tabStyleFixed = App.selectedTabInstance .accessiblePathTabView.Resources["PathSectionTabStyle"] as Style;
9595
9696 string componentLabel = "Favorites" ;
9797 string tag = "Favorites" ;
@@ -100,7 +100,7 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
100100 Title = componentLabel ,
101101 Path = tag ,
102102 } ;
103- GetCurrentSelectedTabInstance < ProHome > ( ) . pathBoxItems . Add ( item ) ;
103+ App . selectedTabInstance . pathBoxItems . Add ( item ) ;
104104
105105 }
106106
@@ -110,39 +110,39 @@ private void CardPressed(object sender, ItemClickEventArgs e)
110110 if ( BelowCardText == "Downloads" )
111111 {
112112
113- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 2 ;
113+ App . selectedTabInstance . locationsList . SelectedIndex = 2 ;
114114 //instanceViewModel.TextState.isVisible = Visibility.Collapsed;
115- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , DownloadsPath ) ;
116- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
115+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , DownloadsPath ) ;
116+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
117117 }
118118 else if ( BelowCardText == "Documents" )
119119 {
120120
121- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 3 ;
122- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , DocumentsPath ) ;
123- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
121+ App . selectedTabInstance . locationsList . SelectedIndex = 3 ;
122+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , DocumentsPath ) ;
123+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
124124 }
125125 else if ( BelowCardText == "Pictures" )
126126 {
127127
128- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 4 ;
129- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( PhotoAlbum ) , PicturesPath ) ;
130- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
128+ App . selectedTabInstance . locationsList . SelectedIndex = 4 ;
129+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( PhotoAlbum ) , PicturesPath ) ;
130+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
131131
132132 }
133133 else if ( BelowCardText == "Music" )
134134 {
135135
136- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 5 ;
137- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , MusicPath ) ;
138- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
136+ App . selectedTabInstance . locationsList . SelectedIndex = 5 ;
137+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , MusicPath ) ;
138+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
139139 }
140140 else if ( BelowCardText == "Videos" )
141141 {
142142
143- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 6 ;
144- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , VideosPath ) ;
145- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
143+ App . selectedTabInstance . locationsList . SelectedIndex = 6 ;
144+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , VideosPath ) ;
145+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
146146 }
147147 }
148148
@@ -162,37 +162,37 @@ private void Button_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEven
162162 if ( clickedButton . Tag . ToString ( ) == "\xE896 " ) // Downloads
163163 {
164164
165- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 2 ;
166- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , DownloadsPath ) ;
167- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
165+ App . selectedTabInstance . locationsList . SelectedIndex = 2 ;
166+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , DownloadsPath ) ;
167+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
168168 }
169169 else if ( clickedButton . Tag . ToString ( ) == "\xE8A5 " ) // Documents
170170 {
171171
172- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 3 ;
173- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , DocumentsPath ) ;
174- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
172+ App . selectedTabInstance . locationsList . SelectedIndex = 3 ;
173+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , DocumentsPath ) ;
174+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
175175 }
176176 else if ( clickedButton . Tag . ToString ( ) == "\xEB9F " ) // Pictures
177177 {
178178
179- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 4 ;
180- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( PhotoAlbum ) , PicturesPath ) ;
181- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
179+ App . selectedTabInstance . locationsList . SelectedIndex = 4 ;
180+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( PhotoAlbum ) , PicturesPath ) ;
181+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
182182 }
183183 else if ( clickedButton . Tag . ToString ( ) == "\xEC4F " ) // Music
184184 {
185185
186- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 5 ;
187- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , MusicPath ) ;
188- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
186+ App . selectedTabInstance . locationsList . SelectedIndex = 5 ;
187+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , MusicPath ) ;
188+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
189189 }
190190 else if ( clickedButton . Tag . ToString ( ) == "\xE8B2 " ) // Videos
191191 {
192192
193- GetCurrentSelectedTabInstance < ProHome > ( ) . locationsList . SelectedIndex = 6 ;
194- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , VideosPath ) ;
195- GetCurrentSelectedTabInstance < ProHome > ( ) . LayoutItems . isEnabled = true ;
193+ App . selectedTabInstance . locationsList . SelectedIndex = 6 ;
194+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , VideosPath ) ;
195+ App . selectedTabInstance . LayoutItems . isEnabled = true ;
196196 }
197197 }
198198 public static StorageFile RecentsFile ;
@@ -286,24 +286,24 @@ private async void RecentsView_ItemClick(object sender, ItemClickEventArgs e)
286286 }
287287 catch ( UnauthorizedAccessException )
288288 {
289- await GetCurrentSelectedTabInstance < ProHome > ( ) . consentDialog . ShowAsync ( ) ;
289+ await App . selectedTabInstance . consentDialog . ShowAsync ( ) ;
290290 }
291291 catch ( System . ArgumentException )
292292 {
293293 if ( new DirectoryInfo ( path ) . Root . ToString ( ) . Contains ( @"C:\" ) )
294294 {
295- GetCurrentSelectedTabInstance < ProHome > ( ) . drivesList . SelectedIndex = 0 ;
296- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , path ) ;
295+ App . selectedTabInstance . drivesList . SelectedIndex = 0 ;
296+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , path ) ;
297297 }
298298 else
299299 {
300- foreach ( ListViewItem drive in GetCurrentSelectedTabInstance < ProHome > ( ) . drivesList . Items )
300+ foreach ( ListViewItem drive in App . selectedTabInstance . drivesList . Items )
301301 {
302302 if ( drive . Tag . ToString ( ) == new DirectoryInfo ( path ) . Root . ToString ( ) )
303303 {
304- GetCurrentSelectedTabInstance < ProHome > ( ) . drivesList . SelectedItem = null ;
304+ App . selectedTabInstance . drivesList . SelectedItem = null ;
305305 drive . IsSelected = true ;
306- GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , path ) ;
306+ App . selectedTabInstance . accessibleContentFrame . Navigate ( typeof ( GenericFileBrowser ) , path ) ;
307307 return ;
308308 }
309309 }
0 commit comments