It's time to take a step back to explain what's going to happen next: The way that Microsoft implements Find/Replace in Notepad today is non-standard and would be difficult to recreate using WPF. Complicating matters, my original implementation of Find/Replace is somewhat rudimentary. And so I've spent a lot of time this past summer trying to crack this nut. As with so much else related to this project, I've had some successes and some setbacks. But it's time to pick a path forward.
The decision I've come to is rooted in the core conceit of this project: I have this app, what we might call a legacy app, and I want to modernize it so that it looks and runs well in Windows 11. Microsoft is providing basic support for this work in .NET 9 by supporting what it calls Windows 11 theming in WPF, the app framework I used to create the original version of the app. (Well, not the original version: I created Windows Forms versions of the app before that, but let's stay on target here.) But it's only basic support. There are (many) missing features and bugs, and those are piled on top of the missing features and bugs that were already in WPF. And so we have to be pragmatic. The goal is for this app to be as much like its inspiration, Notepad, as possible. But there are things we can do. And things we cannot.
If you've followed along with this series since the beginning, you've seen the struggle. And in the Step-by-Step posts, you've seen "what we can do" unfolding. Despite all the limitations, there is a lot we can do to modernize this app. But with most of that work complete, we're heading into a gray area between can and cannot. This is the most frustrating part of the project. If something were just impossible, I could at least move on. Some of this is tantalizing close. I want to get it done, and correctly. But because of time, knowledge, and technical issues, I will settle on just getting it done to some degree. I will do what I can. This is the nature of the work.
Find/Replace--a simple name for a complex set of functionality--is one of three big gray areas that has consistently set me back. (The other two are tabs and getting theming/styling to fully work.) This makes sense, in a way, because Find/Replace has always been a problem, in every version of this app I've made over the past several years.
It started in 2019 with the Windows Forms/C# version of .NETpad, the second version of the app I created, and the first I documented publicly. The parallels are interesting. Then, as now, Microsoft had implemented its interface for Find/Replace using a type of window that wasn't available to me. And then, as now, I lacked the technical know-how to create a reasonable workaround.
In that case, I got help from a reader, who provided the basic logic behind for the core Find/Replace features--Find, Find Next, Find Previous, Replace, and Replace All--and a dialog I could use to approximate the original Microsoft UI. But when I moved on to my...
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.