예제 #1
0
        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);
            }
        }
예제 #2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            var folderPath = (string)e.Parameter;
            var files      = await FolderFileHelper.GetAllFilesFromPath(folderPath);

            pathmodel        = new PathModel(folderPath);
            this.DataContext = pathmodel;
            if (files.Count > 0)
            {
                Debug.WriteLine("Bro im in");
                var list = await FolderFilesViewModel.populateGrid(files);

                foreach (var item in list)
                {
                    videoFiles.Add(item);
                }
            }
        }
예제 #3
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();
                }
            }
        }