The UWP Files: Be True to Your School (Premium)

After experiencing many frustrations, I had an interesting breakthrough with my Universal Windows Platform (UWP) version of .NETpad, the Notepad clone. This success mirrors an earlier and similar success I had with WPF. And coincidentally enough, it is also related to font support.

So let’s step back for a moment so I can explain what led to this.

I think most understand that we bring biases to these things we do, and that they’re based on experience and preference, but I now have two good examples of why breaking out of that rut can be liberating. When I started working with Visual Basic and Windows Forms, I was struck by how much you could get done without writing any code at all, thanks to the visual forms designer in Visual Studio, and by how similar it was to the classic VB of old. And WinForms seems ideal for classic desktop applications like a Notepad clone, even though there were frustrations about the lack of support for features both legacy (Task windows) and modern (sophisticated display scaling support, Windows 10 themes).

But thanks in part to help from some readers, I was able to “complete” .NETpad, my Notepad clone, using VB and WinForms, and I even added several useful features, including word count, auto-save, (editor) theme support, and more. I later privately ported the entire application to C# as well, in order to prepare myself for future projects.

So it was on to C# and WPF (and .NET Core 3.1, instead of the legacy .NET Framework). And I brought my biases with me, which in this case included wanting to duplicate .NETpad/Notepad as closely as possible with the newer technologies. And then I described my frustrations with some features that were present in WinForms but missing, inexplicably, in WPF, most notably a Font dialog. (And, related to this, that Microsoft had so dramatically changed how fonts work in WPF that moving back and forth between the old way of doing things and then new was quite difficult.)

A reader helped me with the non-discoverable way to use the WinForms Fonts dialog in WPF, but that latter (parenthetical) issue meant that it was still not ideal. But that’s when the mini-epiphany hit: Instead of fighting WPF and trying to make it adapt to what I wanted, I decided to embrace WPF and use some of its unique strengths---most notably its support for creating XAML-based user interfaces---instead.

In doing so, I “completed” the WPF version of .NETpad by creating three custom XAML-made dialogs---Font, About, and Input Box---and I could see spending more time and replacing all of the other system dialogs in the application with my own. But I wanted to move forward, too. And after considering both UWP and Xamarin for the next app (don’t worry, I’ll get to Xamarin too), I decided to go back to an earlier effort to port .NETpad to UWP.

But here’s the thing. Once again, I found myself in the same trap: Even while understanding that UWP is a different thing than WinForms...

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