I am implementing an application with modelviewviewmodel, i have one view, where you can change all the properties of an object, this object is a property of a viewmodel from the view. But it also have te menu bar like windows, with file => open, new file, save, save as..
If i click on new file, the application have to make a total new object. It works fine, so the object is resetted. Every field and things becomes empty again. But now i want to implement a confirmation window, because if the user clicks accidently on new file, he loses everything. and in that confirmation window, i have 2 buttons, yes and no: yes, the application resets all the values, but if he clicks on no, the window just closes and the user can work further with the current object. My problem is with the yes button. It is a window, but the method, to create a new object, is in my viewmodel. So in my viewmodel is:
this.Examination = new Examination();
Without confirmation, i just go from my view to this method in the viewmodel, but now how can i go from the confirmation window (after clicking on yes) to my viewmodel?
SOmeone who can help me out please?
Create a command in your view model that creates the new object and bind the yes button to that command.