I am able to save the data to database using the save command.
But the entered data is not cleared after successfully save operation.
How do I clear the values in ViewModel itself.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Easy – you instantiate (“new up”) a new ViewModel and bind it to the View. What makes you think you need to recycle the old one?
Arguably a ViewModel should not know about clearing itself – that is the job of the Model, and the easiest most pain free way to do it is to new up another one, throw the old one away.