‫Let's continue with the view model and finish the methods.
‫So I'll start with function update and delete.
‫And it took into the parameter a contact object.
‫Then here I'll add input name dot value.
‫Because I'm working with mutable live data I should use value attribute name or the contact name.
‫The input email dot value equals to contact dot email its update or delete.
‫Yes, it's update or delete.
‫Set it to true contact to update or delete equals to contact the current.
‫Contact the past contact as a parameter and save or update button text dot value.
‫Set it to update and set the clear all or delete button.
‫Text to delete.
‫I need to use dot value because it's a mutable live data.
‫If we scroll up, there is an error here in the view model I need to implement the members, so click
‫on it.
‫We have to members add on property changed and remove on property changed callback.
‫Click okay.
‫And these are the methods I'm not going to make anything with them.
‫Just implement these two methods okay.
‫This is our review model.
‫We have these functions the insert delete update and clear.
‫All these functions call these functions in the repository.
‫So these functions call the repository functions.
‫We have additional functions save or update.
‫It will detect if we are updating or inserting a new contact in our database.
‫And clear all or delete is detecting if it is a delete or clear all functionality.
‫Also, we have this initiate, update and delete.
‫This will detect if it is an update or delete functionality, because I'm using the same button for
‫save and update and update and delete functions.