Premium

The WPF Notepad Project: Save, Save As, New, New Window (Premium)

Avatar
1

Anyway, like other document-based applications, .NETpad lets the user save a document (“Save”) or save a document using a different file name (“Save As”). But it’s a little more nuanced then that: If you’re working with a new, as-yet-unsaved document and you choose to save it, you’re really doing a Save As in that one instance; subsequent saves will call Save instead.

WPF provides support for Save and SaveAs commands. But because we will need to use the functionality from either in other contexts, we’ll create our own Save and SaveAs methods and then call them from SaveCommand_Executed and SaveAsCommand_Executed. (And later, from elsewhere too.)

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