11using Files . Helpers ;
2+ using Files . UserControls ;
23using Files . ViewModels ;
3- using Files . Views ;
44using Microsoft . Toolkit . Mvvm . ComponentModel ;
55using Microsoft . Toolkit . Uwp ;
66using System ;
@@ -69,34 +69,34 @@ private async void RemoveEnumerateDrivesAsync(CoreApplicationView sender, Window
6969
7070 public async Task RemoveLibrarySideBarItemsUI ( )
7171 {
72- MainPage . SideBarItems . BeginBulkOperation ( ) ;
72+ SidebarControl . SideBarItems . BeginBulkOperation ( ) ;
7373
7474 try
7575 {
76- var item = ( from n in MainPage . SideBarItems where n . Text . Equals ( "SidebarLibraries" . GetLocalized ( ) ) select n ) . FirstOrDefault ( ) ;
76+ var item = ( from n in SidebarControl . SideBarItems where n . Text . Equals ( "SidebarLibraries" . GetLocalized ( ) ) select n ) . FirstOrDefault ( ) ;
7777 if ( ! App . AppSettings . ShowLibrarySection && item != null )
7878 {
79- MainPage . SideBarItems . Remove ( item ) ;
79+ SidebarControl . SideBarItems . Remove ( item ) ;
8080 }
8181 }
8282 catch ( Exception )
8383 { }
8484
85- MainPage . SideBarItems . EndBulkOperation ( ) ;
85+ SidebarControl . SideBarItems . EndBulkOperation ( ) ;
8686 }
8787
8888 private async Task SyncLibrarySideBarItemsUI ( )
8989 {
9090 await CoreApplication . MainView . CoreWindow . Dispatcher . RunAsync ( CoreDispatcherPriority . Normal , async ( ) =>
9191 {
92- await MainPage . SideBarItemsSemaphore . WaitAsync ( ) ;
92+ await SidebarControl . SideBarItemsSemaphore . WaitAsync ( ) ;
9393 try
9494 {
95- MainPage . SideBarItems . BeginBulkOperation ( ) ;
95+ SidebarControl . SideBarItems . BeginBulkOperation ( ) ;
9696
9797 try
9898 {
99- if ( App . AppSettings . ShowLibrarySection && ! MainPage . SideBarItems . Contains ( librarySection ) )
99+ if ( App . AppSettings . ShowLibrarySection && ! SidebarControl . SideBarItems . Contains ( librarySection ) )
100100 {
101101 librarySection = new LocationItem ( )
102102 {
@@ -107,8 +107,7 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio
107107 SelectsOnInvoked = false ,
108108 ChildItems = new ObservableCollection < INavigationControlItem > ( )
109109 } ;
110-
111- MainPage . SideBarItems . Insert ( 1 , librarySection ) ;
110+ SidebarControl . SideBarItems . Insert ( 1 , librarySection ) ;
112111
113112 libraryItems . Clear ( ) ;
114113 libraryItems . Add ( AppSettings . DocumentsPath ) ;
@@ -144,13 +143,13 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio
144143 {
145144 }
146145
147- MainPage . SideBarItems . EndBulkOperation ( ) ;
146+ SidebarControl . SideBarItems . EndBulkOperation ( ) ;
148147 }
149148 finally
150149 {
151- MainPage . SideBarItemsSemaphore . Release ( ) ;
150+ SidebarControl . SideBarItemsSemaphore . Release ( ) ;
152151 }
153152 } ) ;
154153 }
155154 }
156- }
155+ }
0 commit comments