Apart from inserting data to a table, it is often necessary to update values. Of course, such an operation is also supported in the case of UWP applications using a SQLite database. In this recipe, you will learn how to achieve this goal.
As an example, you will modify the project from the previous recipe by allowing a user to add and edit entries. So, the application will contain almost all the features necessary to become a real offline blog, in which data is stored in the local database.
To modify the preceding example to allow a user to add or edit data of entries, perform the following steps:
Modify the code of the
MainViewModel
class, in theMainViewModel.cs
file, by adding the field with an identifier of the currently edited entry (or 0 if the entry is currently being added, named_entryId
). In addition to this, add properties that represent the title...