private async void _grid_ItemClick(object sender, ItemClickEventArgs e)
        {
            videoFiles.Clear();
            var itemClicked = e.ClickedItem as FolderVideoModel;

            try
            {
                StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(itemClicked.videoPath);

                pathmodel        = new PathModel(folder.Path);
                this.DataContext = pathmodel;
                var fileList = await FolderFileHelper.GetAllFilesFromFolder(folder);

                Debug.WriteLine("click disabled");
                var list = await FolderFilesViewModel.populateGrid(fileList);

                foreach (var item in list)
                {
                    videoFiles.Add(item);
                }
            }
            catch (Exception ex) {
                StorageFile file = await StorageFile.GetFileFromPathAsync(itemClicked.videoPath);

                Frame.Navigate(typeof(Now_Playing), file);
            }
        }
Exemple #2
0
        private async void nav_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
        {
            Debug.WriteLine("back");
            var path = PathModel.FPath;

            Debug.WriteLine(path);

            if (FoldersFiles.pathTree.Contains(path))
            {
                Debug.WriteLine("contains " + path);
                // folder = StorageFolder.GetFolderFromPathAsync(path);
                var parentDir = Directory.GetParent(path);
                Debug.WriteLine(parentDir);
                Debug.WriteLine(parentDir.FullName);
                var folder = await StorageFolder.GetFolderFromPathAsync(parentDir.FullName);



                var pathmodel = new PathModel(parentDir.FullName);
                FoldersFilesGrid.FFGrid.DataContext = pathmodel;
                var files = await FolderFileHelper.GetAllFilesFromFolder(folder);

                // FoldersFilesGrid ff = new FoldersFilesGrid();
                var list = await FolderFilesViewModel.populateGrid(files);

                FoldersFilesGrid.FFGrid.videoFiles.Clear();
                foreach (var item in list)
                {
                    FoldersFilesGrid.FFGrid.videoFiles.Add(item);
                }

                // if (contentFrame.CanGoBack) contentFrame.GoBack();
            }
            else
            {
                Debug.WriteLine($"Access Denied. Path not found");
                FoldersFiles.pathTree.ToList().Clear();
                if (contentFrame.CanGoBack)
                {
                    contentFrame.GoBack();
                }
            }
        }
Exemple #3
0
        private async void GridItemClick(object sender, ItemClickEventArgs e)
        {
            var item = e.ClickedItem as FolderModel;

            Debug.WriteLine(item.path);

            StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(item.path);

            // var token = FolderFileHelper.AddFolderToFutureAccessList(folder);
            var subFolderPaths = await FolderFileHelper.GetSubfoldersPathsFromFolder(folder);

            pathTree = subFolderPaths;
            var fileList = await FolderFileHelper.GetAllFilesFromFolder(folder);


            if (fileList.Count > 0)
            {
                foreach (var file in fileList)
                {
                    Debug.WriteLine(file.Name);
                }
                MainPage.rootFrame.Navigate(typeof(FoldersFilesGrid), folder.Path);
            }
        }