Hawkynt.NativeForms
1.0.0.245
dotnet add package Hawkynt.NativeForms --version 1.0.0.245
NuGet\Install-Package Hawkynt.NativeForms -Version 1.0.0.245
<PackageReference Include="Hawkynt.NativeForms" Version="1.0.0.245" />
<PackageVersion Include="Hawkynt.NativeForms" Version="1.0.0.245" />
<PackageReference Include="Hawkynt.NativeForms" />
paket add Hawkynt.NativeForms --version 1.0.0.245
#r "nuget: Hawkynt.NativeForms, 1.0.0.245"
#:package Hawkynt.NativeForms@1.0.0.245
#addin nuget:?package=Hawkynt.NativeForms&version=1.0.0.245
#tool nuget:?package=Hawkynt.NativeForms&version=1.0.0.245
Hawkynt.NativeForms
A trim- and AOT-compatible UI toolkit with a Windows Forms-shaped API, rendering through real platform widgets where it counts and owner-drawing everything else in the host platform's visual style.
๐ฆ Installation
dotnet add package Hawkynt.NativeForms
This is the platform-agnostic core: the controls, layout, binding and theming, plus the backend abstraction. It renders nothing on its own โ add at least one backend and register it before creating a window.
โจ Features
- A
System.Windows.Forms-shaped API:Form,Button,Label, aControlscollection,Clickevents โ without depending onSystem.Windows.Forms. - Real native widgets for the window and the text-bearing primitives; every other control is owner-drawn in the host platform's own visual style.
- Reflection-free by construction, so the whole surface survives trimming and NativeAOT. The
[GridEditable]source generator ships with this package as a compile-time analyzer; nothing to reference at runtime. - MVVM, MVC and MVP are first-class:
ObservableObject,RelayCommand/RelayCommand<T>and a reflection-free two-wayPropertyBinding<T>inHawkynt.NativeForms.ComponentModel. - A backend a consumer references but never registers is dropped again by the trimmer.
๐งฉ Support matrix
Control families implemented and tested on Windows and Linux. Each family's controls are documented one page per control in the repository docs.
| Family | Coverage | Notes |
|---|---|---|
| Windows & dialogs | โ | Modal, border styles, window state, icon, topmost, opacity; message/file/folder/colour/font dialogs |
| Buttons & toggles | โ | Includes ColorPicker, SplitButton, ToggleSwitch, GridPicker |
| Containers & layout | โ | Dock/flow/table panels, TabControl, Ribbon, SplitContainer, ZoomPanel |
| Lists & trees | โ | ListView (5 views, groups, virtual mode), TreeListView, TreeView |
| Data grid | โ | Virtualized; 15 column kinds, editing, sorting, frozen columns, reorder, merged rows |
| Scheduling | โ | Outlook-style Day/Work Week/Week/Month, virtualized, overlap packing |
| Text & input | โ | Masked, numeric, rich, search and token/chip inputs |
| Editors & inspectors | โ | CodeTextBox (gutter, tokenizer, completion), attribute-driven PropertyGrid |
| Menus, toolbars, status | โ | Plus Breadcrumb, NotifyIcon, ToolTip |
| Focus model ยท DPI and dark-mode live switching ยท accessibility | โ ๏ธ | Tracked box-by-box in docs/PRD.md |
๐ Quick start
using Hawkynt.NativeForms;
using Hawkynt.NativeForms.Backends;
using Hawkynt.NativeForms.Backends.Windows;
BackendRegistry.Register(new Win32Backend());
var form = new Form { Text = "Hello", Bounds = new(0, 0, 320, 160) };
var button = new Button { Text = "Click me", Bounds = new(20, 20, 140, 36) };
button.Click += (_, _) => button.Text = "Clicked!";
form.Controls.Add(button);
Application.Run(form);
๐ API reference
Every public and protected member of all 311 types, generated from the built assembly and its XML documentation, is in REFERENCE.md.
๐ Dependencies
This package renders nothing by itself. Reference the backends for the platforms you ship on:
| Package | Platform |
|---|---|
Hawkynt.NativeForms.Backends.Windows |
Windows, via USER32 |
Hawkynt.NativeForms.Backends.Gtk |
Linux, via GTK 3 |
Hawkynt.NativeForms.Backends.MacOS |
macOS โ published for completeness; see Limitations |
โ ๏ธ Limitations
- Nothing renders until a backend is registered. Referencing a backend package is not enough.
- The macOS backend is published but not implemented: every entry point throws.
- The focus model, live DPI and dark-mode switching, accessibility and native-peer promotion are
incomplete.
docs/PRD.mdis the authoritative per-box checklist. - Controls are implemented and tested on Windows and Linux. Other platforms are untested.
โค๏ธ Support
If this project saves you time or money, consider supporting its development:
๐ License
Licensed under LGPL-3.0-or-later โ see the repository LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Hawkynt.NativeForms:
| Package | Downloads |
|---|---|
|
Hawkynt.NativeForms.Backends.Windows
The Windows (Win32) backend for NativeForms. A thin, reflection-free, source-generated P/Invoke layer that renders NativeForms controls through native USER32 window classes (top-level windows, BUTTON, STATIC). Trim- and NativeAOT-compatible: it compiles on any OS but only runs on Windows. |
|
|
Hawkynt.NativeForms.Backends.Gtk
The Linux (GTK 3) backend for NativeForms. A thin, reflection-free P/Invoke layer that realizes NativeForms controls as native GTK widgets through libgtk-3, staying fully trim- and NativeAOT-compatible. |
|
|
Hawkynt.NativeForms.Backends.MacOS
The macOS Cocoa backend for NativeForms. Implements native AppKit windows, controls, menus and common dialogs with CI smoke and screenshot coverage; see docs/backends.md for the remaining platform-specific limitations. |
GitHub repositories
This package is not used by any popular GitHub repositories.