Skip to content

Add an isolated native WPF node editor and demo - #40

Draft
xincheng213618 wants to merge 4 commits into
DebugST:mainfrom
xincheng213618:codex/native-wpf-demo
Draft

Add an isolated native WPF node editor and demo#40
xincheng213618 wants to merge 4 commits into
DebugST:mainfrom
xincheng213618:codex/native-wpf-demo

Conversation

@xincheng213618

@xincheng213618 xincheng213618 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a self-contained NativeWpf directory with a native WPF ST.Library.UI.WPF library, demo, documentation, and standalone solution.
  • Keep the original DrawingTools.Graphics contract and present the GDI-rendered surface through a DPI-aware WPF WriteableBitmap.
  • Keep the control library dependency-free; only WpfNodeEditorDemo references ColorVision.UI 1.5.7.
  • Make the demo a full-window node canvas. Nodes are created from the integrated + button or the canvas context menu, so no TreeView or legacy property grid occupies permanent space.
  • Generate a reflection-based property panel beside the single selected node. The demo adapter exposes only STNodePropertyAttribute properties and supplies native WPF editors for System.Drawing.Color, read-only values, and file selection.
  • Include canvas and node context menus, automatic layout, save/open, undo/redo, clipboard actions, fit view, and an integrated execution command.
  • Use cursor-centered wheel zoom in 0.05 steps across the 0.2-5.0 range, plus an explicit canvas drag lock whose manual state remains stable.

Isolation and compatibility

  • Existing ST.Library.UI, WinNodeEditorDemo, legacy WpfNodeEdittorDemo, root README, and the original solution are unchanged by this PR.
  • The new standalone solution only references projects inside NativeWpf.
  • ST.Library.UI.WPF targets net8.0-windows and net10.0-windows and has no NuGet packages. The demo targets net8.0-windows/x64 because the published ColorVision assemblies are AMD64.
  • The Demo's visual tree remains native WPF and contains no WindowsFormsHost. ColorVision.UI transitively brings ColorVision.Common, ColorVision.Themes, HandyControl, log4net, and Newtonsoft.Json; these dependencies do not enter the control library.
  • Existing node namespaces, the original System.Drawing.Graphics drawing API, STND v1 behavior, and the historical WpfNodeEdittorDemo assembly identity are preserved.
  • A consumer references either the WinForms implementation or the WPF implementation, not both assemblies in the same application.

Validation

  • dotnet restore .\NativeWpf\STNodeEditor.Wpf.sln: successful.
  • Debug and Release builds of both ST.Library.UI.WPF target frameworks: 0 warnings, 0 errors.
  • Debug and Release builds of WpfNodeEditorDemo: 0 errors; a full rebuild retains the 66 nullable/member-hiding warnings from the copied sample nodes.
  • dotnet list .\NativeWpf\ST.Library.UI.WPF\ST.Library.UI.WPF.csproj package --include-transitive: no packages for either target framework.
  • Demo package audit: direct ColorVision.UI 1.5.7 only; its transitive dependencies are listed above.
  • Startup smoke: the net8.0-windows demo is responsive with title STNodeEditor WPF Demo and closes normally with exit code 0.
  • UI Automation: no Tree control; all AttrTestNode reflected properties are present; changing a string property survives closing and reopening the panel; changing the node title updates and repositions the panel; selecting all hides the single-node inspector.
  • Zooming from 1.0 to 1.4 moves the node-anchored panel, and the integrated add menu still exposes the five sample node categories.
  • Custom-editor STA smoke: the color and file editors both construct successfully with the packaged theme resources.
  • Small-export regression check: a 1x1 canvas region at 0.5 scale returns a valid 1x1 image.
  • Compatibility check: NumberInputNode retains assembly WpfNodeEdittorDemo and GUID f7bd9ac6-d33b-3fb6-87f8-6eb97692f71b.

@xincheng213618
xincheng213618 force-pushed the codex/native-wpf-demo branch from b798213 to d690d64 Compare August 7, 2026 20:50
@xincheng213618 xincheng213618 changed the title Add a native WPF node editor and modern demo Add an isolated native WPF node editor and demo Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant