From the course: From Console to UI: A Deep Dive into Cross-Platform Development with MAUI

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Saving notes

Saving notes

- [Instructor] In this video, we're going to wire up the save button in our Maui app to create and save new notes using a create note service. To begin, let's add the create note method declaration to our INoteService interface. Now we need to implement the create note method in our note service. We'll do this by creating a public method called CreateNote that accepts a note. And once we have the note instance, we're going to save it to the database by calling _dbcontext.notes.add and pass it a reference to the note. Then we'll use the DB context to save the changes, and that'll add our new note to the database. Now we need to create a new note view model. Now that we've created this new class, let's extend the bindable object. Now it's time for us to create two new getters and setters. The first is going to be to store information about the title of the note and the other is to store the content of the note. Before we create these getters and setters, we're going to need to make two…

Contents