The WPF Notepad Project: Getting Started (Premium)

For this second project, we’re going to recreate our Notepad clone, .NETpad, using C#, Windows Presentation Foundation (WPF), and .NET Core 3.1. But as you may have seen in my short series of posts, The WPF Files, this time will be a bit different: I’ve already created the application, so here I’m doing it again and documenting it as I go. So I should be able to finish it up much more quickly.

That’s good, because the original article series, The WinForms Notepad Project, which focused on a Visual Basic/Windows Forms/.NET Framework version of the Notepad clone, took a lot longer than I had expected. Though on the positive side, I was able to accomplish more than I had hoped, too. Plus during that time, I created a separate C# port (also using WinForms and the .NET Framework.) Yes, I’ve been kind of obsessing over this.

There are two major changes this time around, at least from the perspective of the developer and their daily interactions with code in Visual Studio.

First, we’re using C#. C# is a more professional and powerful language than Visual Basic, but it’s also a bit more complex for beginners. But as a C-like language that is syntactically similar to C++, Java, JavaScript, and other popular languages, C# is a nice onramp to modern software development. It’s my favorite programming language overall. I will try to stick with C# as much as possible moving forward (though some later web projects may derail that goal somewhat).

Second, we’re WPF instead of WinForms. WPF is more modern than WinForms, but it is likewise less approachable for beginners, in part because it doesn’t offer the same simple drag-and-drop rapid application development (RAD) capabilities as its predecessor. But there are huge advantages to the approach taken by WPF, not the least of which is that Microsoft continues using it in newer frameworks and because other development environments---like Google’s Flutter---work similarly as well. So the skills you obtain learning WPF are transferrable.

There’s a third change, the move from .NET Framework to .NET Core, but that should not impact you too much, aside from some workarounds that are needed to make certain things work. Since WPF is a Windows-only technology, we can’t/won’t benefit from any of .NET Core’s cross-platform goodness, but there are allegedly some performance improvements too. Anyway, .NET Core 3.1 is the latest .NET version at the time of this writing.

So let’s get started.

Assuming you’ve already installed Visual Studio, run the Visual Studio Installer application and ensure that the integrated development environment (IDE) is up-to-date. Then, click Modify to examine the available workloads. If you followed along for the VB/WinForms/.NET Framework version of .NETpad, you should already have the .NET desktop development workload installed. If not, select that and click “Install while downloading.”

When that’s all set, run Visual Studio. In...

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