Exemplo n.º 1
0
        //// Window events /////////////////////////////////////////////////////////

        // Load folder represented by clicked button
        private async void RecentFolderButton_Click(object sender, RoutedEventArgs e)
        {
            StorageFolder folder = (StorageFolder)((Button)e.OriginalSource).Tag;

            if (folder == null)
            {
                return;
            }
            Folder rootFolder = new Folder(folder, null);
            Task   t          = model.GetFolderStructure(folder, rootFolder);
            await  t;

            model.RootFolder = rootFolder;
            controller.LoadNewFolder(model.RootFolder);

            var mru = StorageApplicationPermissions.MostRecentlyUsedList;

            mru.Add(folder, folder.Path);

            if (model.Loaded)
            {
                HideMainMenu();
            }
        }
Exemplo n.º 2
0
        public async Task FolderPicker()
        {
            FolderPicker picker = new FolderPicker();

            picker.FileTypeFilter.Add("*");
            StorageFolder folder = await picker.PickSingleFolderAsync();

            if (folder == null)
            {
                return;
            }
            Folder rootFolder = new Folder(folder, null);
            Task   t          = model.GetFolderStructure(folder, rootFolder);
            await  t;

            model.RootFolder = rootFolder;
            LoadNewFolder(model.RootFolder);

            // Add folder to MostRecentlyUsed
            var mru = StorageApplicationPermissions.MostRecentlyUsedList;

            mru.Add(folder, folder.Path);
        }