Modernizing .NETpad: Settings, UI Changes, Spell Check, and More (Premium)

It's been a whirlwind week of rapid improvements to .NETpad. The Settings page is in place, and everything that can work is working properly. I added a "Reset settings" button, similar to what I did for the UWP version of the app. I fixed the Auto save functionality (which was broken somehow). I added spell checking. And I updated the main menu layout to match what Microsoft did with Notepad in Windows 11 as closely as possible.

There's so much more to do, but as I noted last time, this project is progressing quicker than I expected, and I'm able to get more done with WPF than I expected. There are some control differences—Microsoft is clearly using custom styling for the checkmarks in menu items for options that can be toggled on/off, for example, and WPF doesn't (yet?) support the Windows 10/11 ToggleSwitch control—and of course the biggest missing feature, tabs, remains missing. I've removed the Font and About box dialogs, but I still need to address the other windows that pop-up, like some message boxes, Find, Find/Replace, and Go to line. It's getting there.

I am perhaps inordinately proud of this work, given that I'm not a developer: Solving problems is inherently rewarding, and I've overcome some puzzling hurdles. But I would also like to clean up the code—a lot, if possible—and I've wanted to clean up or at least standardize how I style controls. So I created a resource dictionary for that, though it's not clear that this is any more efficient.

During this entire process, I've recreated .NETpad from scratch—well, from my original GitHub repository version—somewhere between 8 and 10 times. The last two were fairly brutal because of all the coding involved, but I wanted to take the time to get what I have changed done correctly (or as correctly as possible). And there's a lot of fit and finish work, though more remains.

For now, I will document what I've done since the last update. This all happened in such a flurry of activity, I'm sure I'll miss something. But here are the broad strokes, roughly in the order they occurred.
Settings
As noted, the Settings page, which takes over the app window when activated, is pretty much there. (Note the use of toggle buttons instead of toggle switches.)

I've implemented each of the settings and settings group found in Notepad settings, though I replaced "Opening files" with my "Auto save" setting because that's needed, and my app doesn't (yet) support tabs. I hide two settings from Notepad ("When Notepad starts" and "Autocorrect") because I've not figured out how to implement them yet. That said, I did leave the "App theme" drop-down there; I just disabled the options.

I'm particularly happy with the "Font" drop-down, though the example text area needs some fit and finish work for when the user chooses a stupidly large font. I completely rewrote a lot of the font code.

WPF doesn't allow me to easily put the "Back" button in the title bar area, as with...

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