I currently have a windows phone 8 application that has a user control that is bound to some view model. In the view model I a have a command property that binds to a button on the view.
I want to popup a message box in the view that asks "Are you sure you want to do X?". If Yes it needs to fire the command that is bound to the button else it needs to not fire the command.
I obviously do not want to fire the MessageBox from the view model since this is view logic. So how do I show the MessageBox in the view and then not fire the command that it is bound to it.
Edit: Let me just make it clear. The command is in the viewmodel and bound in xaml. The MessageBox show is in the view code behind (in the buttons's click event). I would like to keep it like this. My question is just. How do I not fire the command once the botton is pressed and the MessageBox returns Cancel.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…