@@ -44,8 +44,8 @@ public class ItemViewModel
4444 {
4545 public static ObservableCollection < Classic_ListedFolderItem > classicFolderList = new ObservableCollection < Classic_ListedFolderItem > ( ) ;
4646 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 ; } }
4949
5050 public static ObservableCollection < ListedItem > filesAndFolders = new ObservableCollection < ListedItem > ( ) ;
5151 public static ObservableCollection < ListedItem > FilesAndFolders { get { return filesAndFolders ; } }
@@ -59,21 +59,21 @@ public class ItemViewModel
5959 string VideosPath = Environment . GetFolderPath ( Environment . SpecialFolder . MyVideos ) ;
6060
6161 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 ;
7373 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 ;
7777 public static string pageName ;
7878
7979 public static ItemViewModel vm ;
@@ -203,6 +203,10 @@ private async void DisplayConsentDialog()
203203 public static bool IsStopRequested = false ;
204204 public static bool IsTerminated = true ;
205205
206+ public static int NumOfItems ;
207+ public static int NumItemsRead ;
208+ public static int NumOfFiles ;
209+ public static int NumOfFolders ;
206210 public async void GetItemsAsync ( string path )
207211 {
208212 Stopwatch stopwatch = new Stopwatch ( ) ;
@@ -215,15 +219,14 @@ public async void GetItemsAsync(string path)
215219 folder = await StorageFolder . GetFolderFromPathAsync ( path ) ; // Set location to the current directory specified in path
216220 folderList = await folder . GetFoldersAsync ( ) ; // Create a read-only list of all folders in location
217221 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 ;
222226
223227 if ( NumOfItems == 0 )
224228 {
225229 TextState . isVisible = Visibility . Visible ;
226- //return;
227230 }
228231
229232 PUIH . Header = "Loading " + NumOfItems + " items" ;
@@ -233,12 +236,11 @@ public async void GetItemsAsync(string path)
233236 {
234237 PVIS . isVisible = Visibility . Visible ;
235238 }
236-
237- if ( NumOfFolders > 0 )
239+ if ( NumOfFolders > 0 )
238240 {
239241 foreach ( StorageFolder fol in folderList )
240242 {
241- if ( IsStopRequested )
243+ if ( IsStopRequested )
242244 {
243245 IsStopRequested = false ;
244246 IsTerminated = true ;
@@ -252,7 +254,7 @@ public async void GetItemsAsync(string path)
252254 gotFolType = "Folder" ;
253255 gotFolImg = Visibility . Visible ;
254256 gotFileImgVis = Visibility . Collapsed ;
255-
257+
256258
257259 if ( pageName == "ClassicModePage" )
258260 {
@@ -266,10 +268,10 @@ public async void GetItemsAsync(string path)
266268
267269 NumItemsRead ++ ;
268270 }
269-
271+
270272 }
271273
272- if ( NumOfFiles > 0 )
274+ if ( NumOfFiles > 0 )
273275 {
274276 foreach ( StorageFile f in fileList )
275277 {
@@ -283,7 +285,7 @@ public async void GetItemsAsync(string path)
283285 UpdateProgUI ( ProgressReported ) ;
284286 gotName = f . Name . ToString ( ) ;
285287 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" )
287289 {
288290 gotType = "Executable" ;
289291 }
@@ -315,7 +317,7 @@ public async void GetItemsAsync(string path)
315317 }
316318 gotFileImgVis = Visibility . Visible ;
317319
318- if ( pageName == "ClassicModePage" )
320+ if ( pageName == "ClassicModePage" )
319321 {
320322 ClassicFileList . Add ( new ListedItem ( ) { FileImg = icon , FileIconVis = gotFileImgVis , FolderImg = gotFolImg , FileName = gotName , FileDate = gotDate , FileExtension = gotType , FilePath = gotPath } ) ;
321323 }
@@ -326,14 +328,15 @@ public async void GetItemsAsync(string path)
326328 NumItemsRead ++ ;
327329 }
328330
329-
331+
330332 }
331- if ( pageName != "ClassicModePage" )
333+ if ( pageName != "ClassicModePage" )
332334 {
333335 PVIS . isVisible = Visibility . Collapsed ;
334336 }
335-
337+
336338 IsTerminated = true ;
339+
337340 }
338341 catch ( UnauthorizedAccessException )
339342 {
@@ -344,7 +347,6 @@ public async void GetItemsAsync(string path)
344347
345348 }
346349
347-
348350 public static ProgressPercentage progressPER = new ProgressPercentage ( ) ;
349351
350352 public static ProgressPercentage PROGRESSPER
@@ -365,30 +367,23 @@ public static int UpdateProgUI(int level)
365367 return ( int ) level ;
366368 }
367369
368- public static void DisplayCollisionUIWithArgs ( string header , string subHeader )
370+ public static async void DisplayCollisionUIWithArgs ( string header , string subHeader )
369371 {
370372 CollisionBoxHeader . Header = header ;
371373 CollisionBoxSubHeader . SubHeader = subHeader ;
372- CollisionUIVisibility . isVisible = Visibility . Visible ;
374+ await GenericFileBrowser . collisionBox . ShowAsync ( ) ;
375+ //CollisionUIVisibility.isVisible = Visibility.Visible;
373376 }
374377
375- public static void DisplayReviewUIWithArgs ( string header , string subHeader )
378+ public static async void DisplayReviewUIWithArgs ( string header , string subHeader )
376379 {
377380 ConflictBoxHeader . Header = header ;
378381 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;
389384 }
390385
391- public static async void FillTreeNode ( object item , TreeView EntireControl )
386+ public static async void FillTreeNode ( object item , Microsoft . UI . Xaml . Controls . TreeView EntireControl )
392387 {
393388 var PathToFillFrom = ( item as Classic_ListedFolderItem ) . FilePath ;
394389 StorageFolder FolderFromPath = await StorageFolder . GetFolderFromPathAsync ( PathToFillFrom ) ;
0 commit comments