Modernizing .NETpad: New App Version is Now Available on GitHub (Premium)

The source code for .NETpad 3.0 for Windows 11 is now available on GitHub for those who wish to build or expand the app.

This is a major update to the original Windows Presentation Foundation (WPF) version of .NETpad that adds support for Windows 11 theming per the changes Microsoft introduced in .NET 9 in late 2024. However, that implementation is buggy and unreliable, and .NETpad 3.0 inherits some of those problems.

This version of the app supports a single document per app instance as before, but a future version will add support for tabs and multiple documents, and .NETpad 3.0 includes some code related to that coming shift.

Download the source code here.
What's new
Windows 11 theming support. This version of the app looks and feels native in Windows 11. In fact, it requires Windows 11, though it wouldn't be too difficult to adapt it to look and run well in Windows 10 too. It supports Light, Dark, and System theme modes and most Windows 11 controls (WPF doesn't support the native ToggleSwitch control, so I use a ToggleButton instead). And it sports a nice translucent look where appropriate.

Toggle app theme. Like other modern Windows 11 apps, .NETpad 3.0 provides a settings interface so the user can switch between Light, Dark, and System theme modes. There is also a toggle button in the main app window for switching between these modes, with a tooltip that communicates the current app theme. Note that the app will crash if an Expander control is open or has been opened: This is a bug in .NET 9 that Microsoft will fix. So it will work fine in the near future.

Accent color support in custom dialog boxes. The custom dialogs correctly adopt the system accent color for the default button in the new custom dialog boxes. (See below.)

Customized title bar. In an interim step toward the tabbed-based UI coming in the next version of the app, .NETpad 3.0 uses a fully customized title bar area at the top of the window with an app logo, the current document name, a draggable and double-clickable area, and the standard Close, Maximize/Restore, and Close window buttons. For now, you have to type "Alt + Space" to display the system window menu, but a future version will include a right-click capability. This customization also precludes the use of the Snap layouts pop-up that's automatically provided by Windows 11 to apps. I will try to add this feature back in a future version of the app too.

DocumentTab for document-related state management. In an interim step toward the tabbed-based UI coming in the next version of the app, .NETpad 3.0 has been restructured to use a new DocumentTab class that provides document (and tab) state management. For now, the app supports only a single document, so there is only a single DocumentTab object, but the current code will ease the transition to multiple tabs (and documents) in the future.

New Settings interface. .NETpad provides a new Settings interface that takes over th...

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