@@ -38,7 +38,7 @@ public class ItemViewModel<PageType> where PageType : class
3838 private ObservableCollection < Classic_ListedFolderItem > _classicFolderList ;
3939
4040 private StorageFolderQueryResult _folderQueryResult ;
41- private StorageFileQueryResult _fileQueryResult ;
41+ public StorageFileQueryResult _fileQueryResult ;
4242 private CancellationTokenSource _cancellationTokenSource ;
4343 private StorageFolder _rootFolder ;
4444 private QueryOptions _options ;
@@ -142,30 +142,35 @@ private void HomeItems_PropertyChanged(object sender, System.ComponentModel.Prop
142142 public void AddFileOrFolder ( ListedItem item )
143143 {
144144 _filesAndFolders . Add ( item ) ;
145- if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
145+ if ( ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) != null || ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) != null )
146146 {
147- ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) . emptyTextGFB . Visibility = Visibility . Collapsed ;
148- }
149- else if ( typeof ( PageType ) == typeof ( PhotoAlbum ) )
150- {
151- ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) . EmptyTextPA . Visibility = Visibility . Collapsed ;
147+ if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
148+ {
149+ ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) . emptyTextGFB . Visibility = Visibility . Collapsed ;
150+ }
151+ else if ( typeof ( PageType ) == typeof ( PhotoAlbum ) )
152+ {
153+ ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) . EmptyTextPA . Visibility = Visibility . Collapsed ;
154+ }
152155 }
153156
154-
155157 }
156158
157159 public void RemoveFileOrFolder ( ListedItem item )
158160 {
159161 _filesAndFolders . Remove ( item ) ;
160162 if ( _filesAndFolders . Count == 0 )
161163 {
162- if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
164+ if ( ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) != null || ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) != null )
163165 {
164- ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) . emptyTextGFB . Visibility = Visibility . Visible ;
165- }
166- else if ( typeof ( PageType ) == typeof ( PhotoAlbum ) )
167- {
168- ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) . EmptyTextPA . Visibility = Visibility . Visible ;
166+ if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
167+ {
168+ ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) . emptyTextGFB . Visibility = Visibility . Visible ;
169+ }
170+ else if ( typeof ( PageType ) == typeof ( PhotoAlbum ) )
171+ {
172+ ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) . EmptyTextPA . Visibility = Visibility . Visible ;
173+ }
169174 }
170175 }
171176 }
@@ -553,7 +558,7 @@ private async Task AddFile(StorageFile file, CancellationToken token)
553558 }
554559 }
555560
556- private async void FileContentsChanged ( IStorageQueryResultBase sender , object args )
561+ public async void FileContentsChanged ( IStorageQueryResultBase sender , object args )
557562 {
558563 if ( _filesRefreshing )
559564 {
@@ -568,13 +573,16 @@ private async void FileContentsChanged(IStorageQueryResultBase sender, object ar
568573 await CoreApplication . MainView . CoreWindow . Dispatcher . RunAsync ( CoreDispatcherPriority . Normal ,
569574 ( ) =>
570575 {
571- if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
576+ if ( ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) != null || ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) != null )
572577 {
573- ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) . progressBar . Visibility = Visibility . Visible ;
574- }
575- else if ( typeof ( PageType ) == typeof ( PhotoAlbum ) )
576- {
577- ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) . progressBar . Visibility = Visibility . Visible ;
578+ if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
579+ {
580+ ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) . progressBar . Visibility = Visibility . Visible ;
581+ }
582+ else if ( typeof ( PageType ) == typeof ( PhotoAlbum ) )
583+ {
584+ ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) . progressBar . Visibility = Visibility . Visible ;
585+ }
578586 }
579587 } ) ;
580588 _filesRefreshing = true ;
@@ -631,13 +639,16 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio
631639 await CoreApplication . MainView . CoreWindow . Dispatcher . RunAsync ( CoreDispatcherPriority . Normal ,
632640 ( ) =>
633641 {
634- if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
635- {
636- ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) . progressBar . Visibility = Visibility . Collapsed ;
637- }
638- else if ( typeof ( PageType ) == typeof ( PhotoAlbum ) )
642+ if ( ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) != null || ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) != null )
639643 {
640- ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) . progressBar . Visibility = Visibility . Collapsed ;
644+ if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
645+ {
646+ ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) . progressBar . Visibility = Visibility . Collapsed ;
647+ }
648+ else if ( typeof ( PageType ) == typeof ( PhotoAlbum ) )
649+ {
650+ ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) . progressBar . Visibility = Visibility . Collapsed ;
651+ }
641652 }
642653 } ) ;
643654
0 commit comments