@@ -44,8 +44,8 @@ public class ItemViewModel
44
44
{
45
45
public static ObservableCollection < Classic_ListedFolderItem > classicFolderList = new ObservableCollection < Classic_ListedFolderItem > ( ) ;
46
46
public static ObservableCollection < Classic_ListedFolderItem > ClassicFolderList { get { return classicFolderList ; } }
47
- public ObservableCollection < ListedItem > classicFileList = new ObservableCollection < ListedItem > ( ) ;
48
- public ObservableCollection < ListedItem > ClassicFileList { get { return classicFileList ; } }
47
+ public static ObservableCollection < ListedItem > classicFileList = new ObservableCollection < ListedItem > ( ) ;
48
+ public static ObservableCollection < ListedItem > ClassicFileList { get { return classicFileList ; } }
49
49
50
50
public static ObservableCollection < ListedItem > filesAndFolders = new ObservableCollection < ListedItem > ( ) ;
51
51
public static ObservableCollection < ListedItem > FilesAndFolders { get { return filesAndFolders ; } }
@@ -59,21 +59,21 @@ public class ItemViewModel
59
59
string VideosPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyVideos ) ;
60
60
61
61
StorageFolder folder ;
62
- string gotName ;
63
- string gotDate ;
64
- string gotType ;
65
- string gotPath ;
66
- string gotFolName ;
67
- string gotFolDate ;
68
- string gotFolPath ;
69
- string gotFolType ;
70
- Visibility gotFileImgVis ;
71
- Visibility gotFolImg ;
72
- StorageItemThumbnail gotFileImg ;
62
+ static string gotName ;
63
+ static string gotDate ;
64
+ static string gotType ;
65
+ static string gotPath ;
66
+ static string gotFolName ;
67
+ static string gotFolDate ;
68
+ static string gotFolPath ;
69
+ static string gotFolType ;
70
+ static Visibility gotFileImgVis ;
71
+ static Visibility gotFolImg ;
72
+ static StorageItemThumbnail gotFileImg ;
73
73
public static ObservableCollection < Classic_ListedFolderItem > ChildrenList ;
74
- public IReadOnlyList < StorageFolder > folderList ;
75
- public IReadOnlyList < StorageFile > fileList ;
76
- public bool isPhotoAlbumMode ;
74
+ public static IReadOnlyList < StorageFolder > folderList ;
75
+ public static IReadOnlyList < StorageFile > fileList ;
76
+ public static bool isPhotoAlbumMode ;
77
77
public static string pageName ;
78
78
79
79
public static ItemViewModel vm ;
@@ -203,6 +203,10 @@ private async void DisplayConsentDialog()
203
203
public static bool IsStopRequested = false ;
204
204
public static bool IsTerminated = true ;
205
205
206
+ public static int NumOfItems ;
207
+ public static int NumItemsRead ;
208
+ public static int NumOfFiles ;
209
+ public static int NumOfFolders ;
206
210
public async void GetItemsAsync ( string path )
207
211
{
208
212
Stopwatch stopwatch = new Stopwatch ( ) ;
@@ -215,15 +219,14 @@ public async void GetItemsAsync(string path)
215
219
folder = await StorageFolder . GetFolderFromPathAsync ( path ) ; // Set location to the current directory specified in path
216
220
folderList = await folder . GetFoldersAsync ( ) ; // Create a read-only list of all folders in location
217
221
fileList = await folder . GetFilesAsync ( ) ; // Create a read-only list of all files in location
218
- int NumOfFolders = folderList . Count ; // How many folders are in the list
219
- int NumOfFiles = fileList . Count ; // How many files are in the list
220
- int NumOfItems = NumOfFiles + NumOfFolders ;
221
- int NumItemsRead = 0 ;
222
+ NumOfFolders = folderList . Count ; // How many folders are in the list
223
+ NumOfFiles = fileList . Count ; // How many files are in the list
224
+ NumOfItems = NumOfFiles + NumOfFolders ;
225
+ NumItemsRead = 0 ;
222
226
223
227
if ( NumOfItems == 0 )
224
228
{
225
229
TextState . isVisible = Visibility . Visible ;
226
- //return;
227
230
}
228
231
229
232
PUIH . Header = "Loading " + NumOfItems + " items" ;
@@ -233,12 +236,11 @@ public async void GetItemsAsync(string path)
233
236
{
234
237
PVIS . isVisible = Visibility . Visible ;
235
238
}
236
-
237
- if ( NumOfFolders > 0 )
239
+ if ( NumOfFolders > 0 )
238
240
{
239
241
foreach ( StorageFolder fol in folderList )
240
242
{
241
- if ( IsStopRequested )
243
+ if ( IsStopRequested )
242
244
{
243
245
IsStopRequested = false ;
244
246
IsTerminated = true ;
@@ -252,7 +254,7 @@ public async void GetItemsAsync(string path)
252
254
gotFolType = "Folder" ;
253
255
gotFolImg = Visibility . Visible ;
254
256
gotFileImgVis = Visibility . Collapsed ;
255
-
257
+
256
258
257
259
if ( pageName == "ClassicModePage" )
258
260
{
@@ -266,10 +268,10 @@ public async void GetItemsAsync(string path)
266
268
267
269
NumItemsRead ++ ;
268
270
}
269
-
271
+
270
272
}
271
273
272
- if ( NumOfFiles > 0 )
274
+ if ( NumOfFiles > 0 )
273
275
{
274
276
foreach ( StorageFile f in fileList )
275
277
{
@@ -283,7 +285,7 @@ public async void GetItemsAsync(string path)
283
285
UpdateProgUI ( ProgressReported ) ;
284
286
gotName = f . Name . ToString ( ) ;
285
287
gotDate = f . DateCreated . ToString ( ) ; // In the future, parse date to human readable format
286
- if ( f . FileType . ToString ( ) == ".exe" )
288
+ if ( f . FileType . ToString ( ) == ".exe" )
287
289
{
288
290
gotType = "Executable" ;
289
291
}
@@ -315,7 +317,7 @@ public async void GetItemsAsync(string path)
315
317
}
316
318
gotFileImgVis = Visibility . Visible ;
317
319
318
- if ( pageName == "ClassicModePage" )
320
+ if ( pageName == "ClassicModePage" )
319
321
{
320
322
ClassicFileList . Add ( new ListedItem ( ) { FileImg = icon , FileIconVis = gotFileImgVis , FolderImg = gotFolImg , FileName = gotName , FileDate = gotDate , FileExtension = gotType , FilePath = gotPath } ) ;
321
323
}
@@ -326,14 +328,15 @@ public async void GetItemsAsync(string path)
326
328
NumItemsRead ++ ;
327
329
}
328
330
329
-
331
+
330
332
}
331
- if ( pageName != "ClassicModePage" )
333
+ if ( pageName != "ClassicModePage" )
332
334
{
333
335
PVIS . isVisible = Visibility . Collapsed ;
334
336
}
335
-
337
+
336
338
IsTerminated = true ;
339
+
337
340
}
338
341
catch ( UnauthorizedAccessException )
339
342
{
@@ -344,7 +347,6 @@ public async void GetItemsAsync(string path)
344
347
345
348
}
346
349
347
-
348
350
public static ProgressPercentage progressPER = new ProgressPercentage ( ) ;
349
351
350
352
public static ProgressPercentage PROGRESSPER
@@ -365,30 +367,23 @@ public static int UpdateProgUI(int level)
365
367
return ( int ) level ;
366
368
}
367
369
368
- public static void DisplayCollisionUIWithArgs ( string header , string subHeader )
370
+ public static async void DisplayCollisionUIWithArgs ( string header , string subHeader )
369
371
{
370
372
CollisionBoxHeader . Header = header ;
371
373
CollisionBoxSubHeader . SubHeader = subHeader ;
372
- CollisionUIVisibility . isVisible = Visibility . Visible ;
374
+ await GenericFileBrowser . collisionBox . ShowAsync ( ) ;
375
+ //CollisionUIVisibility.isVisible = Visibility.Visible;
373
376
}
374
377
375
- public static void DisplayReviewUIWithArgs ( string header , string subHeader )
378
+ public static async void DisplayReviewUIWithArgs ( string header , string subHeader )
376
379
{
377
380
ConflictBoxHeader . Header = header ;
378
381
ConflictBoxSubHeader . SubHeader = subHeader ;
379
- ConflictUIVisibility . isVisible = Visibility . Visible ;
380
- }
381
-
382
- public static void DisplayProgUIWithArgs ( string headerText , string messageText , string buttonText , int initialProgBarLevel )
383
- {
384
- PUIH . Header = headerText ;
385
- PUIP . Path = messageText ;
386
- ButtonText . buttonText = buttonText ;
387
- PROGRESSPER . prog = initialProgBarLevel ;
388
- PVIS . isVisible = Visibility . Visible ;
382
+ await GenericFileBrowser . reviewBox . ShowAsync ( ) ;
383
+ //ConflictUIVisibility.isVisible = Visibility.Visible;
389
384
}
390
385
391
- public static async void FillTreeNode ( object item , TreeView EntireControl )
386
+ public static async void FillTreeNode ( object item , Microsoft . UI . Xaml . Controls . TreeView EntireControl )
392
387
{
393
388
var PathToFillFrom = ( item as Classic_ListedFolderItem ) . FilePath ;
394
389
StorageFolder FolderFromPath = await StorageFolder . GetFolderFromPathAsync ( PathToFillFrom ) ;
0 commit comments