.NETpad 2025: Looking Ahead, Feeling a Little Tabby (Premium)

OK, I'm getting ahead of myself here. But it's impossible not to look past 2024's .NETpad modernization work. There's more work to do. The biggest being the long-awaited--but also long-dreaded--tabbed user interface.

Tabs. It was always going to be tabs.

Microsoft in 2023 added a tabbed user interface to Notepad in Windows 11, along with related features so users can choose where to open new documents (in a new tab, or in a new window) and "session" support by which Notepad will, by default, reopen with whatever documents and tabs you were previously using. This was a fairly incredible set of changes for a seemingly simple app that had handled a single document per window for its entire previous existence over 20 years or so. And given how challenging it is to implement this interface in .NETpad, it's both amusing and alarming to me that these changes to Notepad were met with a collective shrug, with many wondering what took so long.

I think I may have some insight into that. Retrofitting a tabbed user interface onto an existing app is a major undertaking. Aside from the obvious user interface changes, it requires a thorough rethinking of the app's architecture. Previously, document management was relatively easy. There was one document per window--meaning, one document per app instance--and I only had a few things to track in that regard. Key among them:

The name of the document ("Untitled.txt" if it was new and unsaved)
Whether the document was saved
Whether any of the text in the document had changed

Even this simple document state could be difficult to handle accurately--as I always feel obligated to point out, I'm not a professional developer--and I of course made my life even more difficult for myself by introducing a related state that Notepad still doesn't handle to this day: Auto save. If the user enables Auto save, there are more things to keep track of, and this feature was a source of constant logic issues for me throughout this past year's modernization effort.

And yet, I can't stop thinking about making my life even more difficult still by implementing the tabbed user interface that Notepad offers. I've described the issues I've run into with theming and styles previously, but leaving that aside, I've spent a lot of time thinking about and, more recently, trying to implement basic support for tabs--and, thus, for multiple documents--in .NETpad to prepare for this future change. And while the theming and style issues remain, and continue preventing me from adding this feature, I think I've done enough work to at least discuss how I think I may handle it. (I also have thoughts on working around the theming issue, but one step forward at a time.)

When the current WPF version of .NETpad fires up, it creates several "global" variables, or application state variables, that I use during runtime to track various things. Using the examples noted above, the three relevant examples are:

DocumentName - A...

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.

Tagged with

Share post

Thurrott