The UWP Notepad Project (Redux): First Steps (Premium)

After far too many struggles, I think I’ve finally gotten the Universal Windows Platform (UWP) version of .NETpad to the point where I can document how I created it. Again.

Note: Yes, you're reading that correctly. I originally published this series of articles in late April, and then lost the originals to a backup error. So I'm republishing them now, one every day or so, with new screenshots that are based on me reimplementing this app on a different PC and ensuring that all the steps are correct. --Paul

--

Unfortunately, I also need to lower expectations up-front: Despite some recent improvements to this platform, UWP just wasn’t designed to create desktop applications. So this version of .NETpad performs more slowly and doesn’t provide the full feature-set that we created in the Windows Forms and Windows Presentation Foundation (WPF) versions of the app. That said, it’s still a decent rendition of a Notepad-type text editor but reimagined a bit for the unique capabilities (and limitations) of UWP.

Here’s what’s missing:

Line (row)/column display. The UWP version of the textbox doesn’t support the notion of lines, even with Word Wrap off.
New window.
Printing. This was a nightmare in WinForms, but it was very easy in WPF. It’s a nightmare again in UWP, and I just can’t be bothered.
Search with Bing. Seems a bit pointless.
Go To. See above about the lack of support for lines.
Themes. This is actually doable, but one of the many rabbit holes I went down involved theming the app itself, and it just requires too much code. But as I complete the app again while documenting it, I’ll look into (re)adding this.

Beyond that, the UWP version of .NETpad offers some nice features. For example, the UWP textbox provides an automatic context menu, allowing me to not clutter the main command bar with buttons for Cut, Copy, Paste, and so on, and it has spell-checking built-in. The UI is a bit more modern, with command bars on the top and bottom, though I can’t say I’m a fan. But I do like the custom Settings panel, which slides in from the side, and the custom Save prompt and Find and Replace dialogs quite a bit. In fact, I’m curious about trying to duplicate them in WPF now.

Which raises an interesting point. Now that I’ve tried UWP, I feel like a more modern version of the WPF version of the app would make a lot more sense than the UWP version. And that the current WPF version is, in many ways, still the superior version. I may spend a few weeks with WPF again to see whether evolving that codebase makes any sense before moving on to something else.

But before that, UWP.
New project
Before getting started, use the Visual Studio Installer application to add the “Universal Windows Platform development” workload to Visual Studio if you haven’t already. Then, launch Visual Studio and create a new “Blank App (Universal Windows)” project. Name it as “DotNETpadUWP” (no quotes) an...

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

Please check our Community Guidelines before commenting

Windows Intelligence In Your Inbox

Sign up for our new free newsletter to get three time-saving tips each Friday

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Thurrott © 2024 Thurrott LLC