This past weekend, I got much further than expected, and more quickly than expected, in modernizing the design of .NETpad for Windows 11. There's still so much more to do, but I'm surprised to discover I'll be able to do more of this work in WPF than I had any right to hope.
In Modernizing .NETpad: Next Steps (Premium), I described the quick and dirty method I used to get a minimally modernized version of my app up-to-date. To be clear, there are more sophisticated ways to do what I did—for example, I should be using resource dictionaries to handle control styles/colors—and doing that correctly is definitely on my to-do list. But this is also in some ways an interesting real-world look at the challenges developers face with their legacy apps, and what one can do to modernize them. Anyway, as I left it at the end of that article, .NETpad was mostly where I wanted it visually. It supports Windows 11 theming and all of its user interfaces look right in Windows 11. The app is functionally unchanged, but it's been brought into the Windows 11 era.
I've been thinking about, and researching, what I could do beyond the basics. From what I could tell, adopting certain new features in the modern Windows 11 version of Notepad would likely require a new version of the app based on the Windows App SDK and WinUI 3. But I wanted to see how much I could do with just WPF, too. Ideally, using native controls when possible. But I'm not above kludging something together, either.
When you compare Notepad in Windows 11 to .NETpad, there are two major visual and functional differences. The biggest, of course, is that Notepad supports multiple documents through tabs, whereas .NETpad still requires multiple windows. And the second biggest is its new, modern Settings pane, an interface that takes over the main application window.
You can implement tabs in WPF, and I've been experimenting with that. The issue there is whether it can look anything like it does in Notepad, as that app was updated with a new Windows App SDK/WinUI 3 user interface façade that takes advantage of modern new title bar hiding techniques that are not available (natively) in WPF. We'll see: That work continues.
The Settings interface seemed like the simpler choice from an implementation perspective. First, I would create the menu bar-based Settings (gear) icon and link it to the About box, work I had completed previous to publishing that earlier article. Then, I would create a Settings window in XAML, wire up all the features it would need to offer, and then I'd look into ways in which I could transform that window into a view that would replace, or sit on top of, the main application window and visually recreate what you see in Notepad.
I went down numerous rabbit holes, examining WPF constructs like frames, navigation interfaces, pages, user controls, and more. I was thinking about how I had implemented the Settings slide-in pane for the UWP version of .NETpad and whether that...
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.