As with directories, it is also possible to iterate through the files located in a given folder. You will learn how to do this in this recipe.
As an example, the project from the previous recipe will be modified by adding an Iterate through files button. Once you click on it, a list of filenames from the
Book directory will be presented in the text block.
To step through this recipe, you need a project from the previous recipe.
To create an example that gets a list of files from a given directory, as well as iterate through them, perform the following steps:
MainPage.xamlfile as follows:
<Page (...)> <StackPanel> (...) ...