The application could use files with various types of content, such as plain text, as presented in the previous recipe. However, you can also use XML for formatting the content, especially when it should be structured. While developing UWP applications, you can use a set of classes to create an XML content, such as XmlWriter
, XDocument
, or XElement
. Then, you can save the XML-formatted content to a file. In this recipe, you will learn how to do it.
As an example, you will create an application for adding data of important events. For each event, both the date and description will be set. The solution will save the data of all the entered events into an XML file. The design of the page is shown as follows: