Examples VM Layer Map

Notes Workspace composition contract across C#, Python, TypeScript, and Swift

Examples VM Layer Map Notes Workspace composition contract across C#, Python, TypeScript, and Swift Examples VM Layer Map Notes Workspace composition contract across C#, Python, TypeScript, and Swift VM layer contract Framework adapters and host seams WorkspaceVM wraps AggregateVM6 root and forwards lifecycle owns notebooksRoot, notesView, noteForm, statusBar, notifications, capabilityActions focusedVM derives from current notebook / note / notes view ThemeVM palette + accent + font scale workspace-owned sibling VM GlobalSearchVM TokenPagedComposition-based forward-token all-notes search NotebooksRootVM tree-style notebook navigation addNotebook emits TreeStructureChangedMessage expand/collapse state NotesViewVM PagedComposition over notes searchTerm + starred filter current NoteVM drives editor binding NoteFormVM FormVM<NoteModel> title validation + tag autocomplete DiscriminatorVM edit/preview mode StatusBarVM DerivedProperty text slots note count, starred, editing state NotificationsVM visible NotificationVM list hub-driven toast region cap 5 visible items CapabilityActionsVM DerivedProperty<ActionVM[]> capability-aware action bar Repository + models NotebookModel / NoteModel loadAll, loadNotes, save, delete, search Property / command / collection bridges adapter code subscribes once to VM signals framework-native disabled/binding updates DialogService + dispatcher host modal stack and UI scheduler pure-VM contract leaves UI state out of VMs Per-framework views Avalonia Textual React SwiftUI Cross-flavor parity facts The Notes Workspace portfolio exercises 19 VMx features in every flagship host. ThemeVM remains a workspace-owned sibling rather than an AggregateVM7 child, while GlobalSearchVM demonstrates TokenPagedComposition. Views stay thin; adapter code owns the framework-native property, command, collection, dialog, and dispatcher bridges. Component1 Component2 Component3 Component4 Component5 Component6 sibling VM current notebook -> bindTo() current note saved / dirty / valid focusedVM capabilities load / mutate save / export post / resolve bind / render

Root composition

  • WorkspaceVM presents a stable language-neutral VM surface even though C# AggregateVM6 is sealed.
  • All four examples therefore wrap composition rather than subclassing the aggregate root directly.
  • The same child responsibilities show up in each host implementation.

Feature coverage

  • NotesViewVM covers paging, filtering, searching, and current selection.
  • NoteFormVM covers FormVM validation, DiscriminatorVM modes, and SearchableState tag suggestions.
  • NotificationsVM and CapabilityActionsVM surface the optional notification and capability-driven UI seams.

Adapter boundary

  • The VM layer stays framework-neutral and view-pure checks enforce that split.
  • Property, command, collection, dialog, and dispatcher adapters bridge each host toolkit to VMx.
  • That separation is why the example portfolio is useful as a documentation reference.