Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public sealed partial class MainPage : Page
- {
- static StorageFolder currentFolder = KnownFolders.PicturesLibrary;
- public MainPage()
- {
- this.InitializeComponent();
- }
- private async void ButtonBase_OnClick(object sender, RoutedEventArgs e)
- {
- await UpdateList();
- }
- private static async Task<List<string>> GetSubFoldersNames()
- {
- if (currentFolder != null)
- {
- var folderList = await currentFolder.GetFoldersAsync();
- currentFolder = folderList.FirstOrDefault();
- return folderList.Select(x => x.DisplayName).ToList();
- }
- else
- {
- return new List<string>();
- }
- }
- private async Task UpdateList()
- {
- var list = await GetSubFoldersNames();
- FoldersListView.ItemsSource = new ObservableCollection<string>(list);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement