@@ -38,7 +38,7 @@ public class ItemViewModel<PageType> where PageType : class
38
38
private ObservableCollection < Classic_ListedFolderItem > _classicFolderList ;
39
39
40
40
private StorageFolderQueryResult _folderQueryResult ;
41
- private StorageFileQueryResult _fileQueryResult ;
41
+ public StorageFileQueryResult _fileQueryResult ;
42
42
private CancellationTokenSource _cancellationTokenSource ;
43
43
private StorageFolder _rootFolder ;
44
44
private QueryOptions _options ;
@@ -142,30 +142,35 @@ private void HomeItems_PropertyChanged(object sender, System.ComponentModel.Prop
142
142
public void AddFileOrFolder ( ListedItem item )
143
143
{
144
144
_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 )
146
146
{
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
+ }
152
155
}
153
156
154
-
155
157
}
156
158
157
159
public void RemoveFileOrFolder ( ListedItem item )
158
160
{
159
161
_filesAndFolders . Remove ( item ) ;
160
162
if ( _filesAndFolders . Count == 0 )
161
163
{
162
- if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
164
+ if ( ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) != null || ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) != null )
163
165
{
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
+ }
169
174
}
170
175
}
171
176
}
@@ -553,7 +558,7 @@ private async Task AddFile(StorageFile file, CancellationToken token)
553
558
}
554
559
}
555
560
556
- private async void FileContentsChanged ( IStorageQueryResultBase sender , object args )
561
+ public async void FileContentsChanged ( IStorageQueryResultBase sender , object args )
557
562
{
558
563
if ( _filesRefreshing )
559
564
{
@@ -568,13 +573,16 @@ private async void FileContentsChanged(IStorageQueryResultBase sender, object ar
568
573
await CoreApplication . MainView . CoreWindow . Dispatcher . RunAsync ( CoreDispatcherPriority . Normal ,
569
574
( ) =>
570
575
{
571
- if ( typeof ( PageType ) == typeof ( GenericFileBrowser ) )
576
+ if ( ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as GenericFileBrowser ) != null || ( GetCurrentSelectedTabInstance < ProHome > ( ) . accessibleContentFrame . Content as PhotoAlbum ) != null )
572
577
{
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
+ }
578
586
}
579
587
} ) ;
580
588
_filesRefreshing = true ;
@@ -631,13 +639,16 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio
631
639
await CoreApplication . MainView . CoreWindow . Dispatcher . RunAsync ( CoreDispatcherPriority . Normal ,
632
640
( ) =>
633
641
{
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 )
639
643
{
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
+ }
641
652
}
642
653
} ) ;
643
654
0 commit comments