Inheritance: IFileInformationFactory
Example #1
0
        private void fileInitialisation()
        {
            var pictureQueryOptions = new QueryOptions();
            // Don't read through all the subfolders.
            pictureQueryOptions.FolderDepth = FolderDepth.Shallow;

            // Apply the query on the PicturesLibrary
            var pictureQuery = KnownFolders.PicturesLibrary.CreateFileQueryWithOptions(pictureQueryOptions);
            // Get picture information
            var picturesInformation = new FileInformationFactory(pictureQuery, ThumbnailMode.PicturesView);
            picturesSource.Source = picturesInformation.GetVirtualizedFilesVector();
        }
        public async void Activate(FileOpenPickerActivatedEventArgs args)
        {
            _fileOpenPickerUI = args.FileOpenPickerUI;
            _fileOpenPickerUI.FileRemoved += this.FilePickerUI_FileRemoved;
            _fileOpenPickerUI.Title = "Select files from the video library";

            QueryOptions qo = new QueryOptions();
            var qr = KnownFolders.VideosLibrary.CreateFileQuery();
            FileInformationFactory fif = new FileInformationFactory(qr, ThumbnailMode.VideosView);

            lstView.ItemsSource = (await fif.GetFilesAsync());

            Window.Current.Content = this;
            Window.Current.Activate();
        }
Example #3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var queryOptions = new QueryOptions();
            queryOptions.FolderDepth = FolderDepth.Deep;
            queryOptions.IndexerOption = IndexerOption.UseIndexerWhenAvailable;
            queryOptions.SortOrder.Clear();
            var sortEntry = new SortEntry();
            sortEntry.PropertyName = "System.FileName";
            sortEntry.AscendingOrder = true;
            queryOptions.SortOrder.Add(sortEntry);

            var fileQuery = KnownFolders.PicturesLibrary.CreateFileQueryWithOptions(queryOptions);
            const uint size = 190; // default size for PicturesView mode
            var fileInformationFactory = new FileInformationFactory(fileQuery, ThumbnailMode.PicturesView, size, ThumbnailOptions.UseCurrentScale, true);
            itemsViewSource.Source = fileInformationFactory.GetVirtualizedFilesVector();
        }