The UWP Notepad Project (Redux): App Close Confirmation (Premium)


Today, I finally tried something I should have tried months ago: I simply started a new project to see whether I could prevent the user from closing that app by displaying a prompt. And it worked. On the first try.

That was confusing, given how much time I’ve spent on this task. But it gave me the opportunity to copy and paste the relevant code between this new app and the UWP version of .NETpad. And when I did that, it also worked: I was able to prevent the user from closing the app by displaying a prompt if there was unsaved data.

Gain unlimited access to Premium articles.

With technology shaping our everyday lives, how could we not dig deeper?

Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.

Become a Premium Member Create a Free Account