Closed zredb closed 4 years ago
Perhaps because it's too late and the application is already shutting down? I'm in mobile so can't test.
I recommend overriding CanCloseAsync
in your shell ViewModel, and putting your logic in there.
Thank you for your quick reply, I will try to use it, thank you.
Great. Please re-open if you still have issues.
I want to implement the function when quit the app, program query the user weather save changes, bug these code can't work: protected override void OnExit(ExitEventArgs e) { var wm= kernel.Get();
var dr=wm.ShowMessageBox("Project has change, do you want to save it?","", MessageBoxButton.YesNo);
if (dr == MessageBoxResult.Yes)
//do something,
}
can anyone give any sugesstion?