O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Choosing a file to save

Similarly to choosing a file to open, it is also possible to show a file picker for selecting a target location where content should be saved. You will learn how to support such a feature in this recipe.

As an example, you will create a page with the Choose a file button. After clicking on it, a file picker will be presented. When a text file is chosen, the name of the current day will be saved within it.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To prepare an example that saves a textual content in the file specified by the user, perform the following steps:

  1. Add the Choose a file button to the page by adjusting the content of the MainPage.xaml file, as follows: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required