Not that I needed a reminder of my failings as a software developer, but the issues I described last week were just that. As was my belated understanding of a possible fix that turned into something I'm pretty happy with. So I guess I've come full circle. Or something.
Without beating this topic to death, I got to a good place in my .NETpad modernization efforts, so I decided to rewrite it from scratch to see if I could refactor the code, improving both the structure and quality. And that was going great as well, until I hit a wall with the remaining parts of the app that require interactivity with a pop-up sub-window of some kind. (A Message Box or Input Box, depending on the feature.) WPF supports Message Box natively, though it's not been modernized for Windows 11 (yet, hopefully). But it doesn't support Inbox Box at all, and I had forgotten that. So I came up with a few different ways I could move forward and then set out to experiment with each, vaguely worried that these might be problems I couldn't solve elegantly.
OK, not vaguely. One of the core strengths of WPF is also one of its core weaknesses: Because you can make almost any custom UI you want with XAML, WPF developers often do just that. But every time you make a custom UI—as I did with the Fonts dialog, About box, and Find, Find/Replace, and Go to line Input Boxes in the original version of this app—you've just committed yourself to also keeping them up-to-date forever. That is, they make look fine when you first make them, but as the Windows UI evolves, your app's custom UIs start looking off, non-native, or out-of-date. And that's assuming you did a reasonably good job to begin with.
I could live with the out-of-date Message Boxes, though every time I saw its modern equivalent in Notepad and elsewhere, it felt like I was being taunted. But the need to create more custom Input Boxes, more non-standard and non-native-looking UIs, was galling to me. It felt wrong. Regardless, I was pretty sure that I'd be stuck using the slide-down panels I described in Modernizing .NETpad: Hitting the WPF Wall (Premium). It would be OK. But not ideal.
I'm not sure how real developers work. But when I run into a problem this big, I isolate it by starting a new Visual Studio project (and then many more as required) so I can hammer at it without impacting the full app. In this case, I started working on side projects to see what I could do to make something reasonably native-looking. I started with more elegant-looking versions of the previously noted slide-down panels. I also looked at using WPF UI, as described earlier. And at just sucking it up and recreating each UI as its own window, as I had done originally. Though I really didn't want that.
Remember, the point here is to modernize .NETpad. For me, this means making it look and work more like the modern Notepad in Windows 11. But many of the modern UIs in that app just aren't available via WPF. And so I need to improvise. In...
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.