Just like folders, files could also be easily renamed using the
RenameAsync method, which is explained in this recipe.
As an example, you will modify the project from the previous recipe by adding a Rename a file button. Once you click on it, the
Notes.txt file (from the
Book directory) should be renamed
To step through this recipe, you need the project from the previous recipe.
To see how to rename a given file, perform the following steps:
MainPage.xamlfile as follows:
<Page (...)> <StackPanel> (...) <Button Content="Rename a file" HorizontalAlignment="Center" VerticalAlignment="Center" Click="BtnRenameFile_Click" /> <TextBlock ...