<Window x:Class="App.MainWindow"
Title="Sample">
<StackPanel>
<TextBox Text="{Binding Name}" />
<Button Command="{Binding Save}">
Save
</Button>
</StackPanel>
</Window>
WPF → Cerneala Compendium
A dense translation manual for developers arriving with WPF instincts and needing to know exactly which instincts transfer, which names merely look familiar, and where Cerneala deliberately becomes a different machine.
This page may already be stale. Cerneala is under daily construction; its API surface, markup grammar, hosts, behavior, limitations, and architecture can evolve substantially. Treat this as a dated field report, not a compatibility contract. Verify claims against the current source and API reference before shipping.
Familiar instincts. Different contracts.
Cerneala borrows the productive mental models of WPF: retained objects, typed properties, logical and visual ownership, measure/arrange, routed events, commands, templated controls, resources, and data-driven UI.
It does not reproduce the WPF runtime. It replaces Dispatcher-led desktop composition with an explicit frame host, a bounded root-owned Relay, dirty queues, render-command caches, backend submission, compiled typed authoring, and a root-owned motion system.
The Relay is useful. It is still not WPF's Dispatcher.
The important translation is not Dispatcher to a class with a different hat. UiRelay accepts cross-thread work and async continuations, but the host drains a bounded FIFO snapshot before scheduler and input work. WPF pumps a desktop dispatcher; Cerneala advances retained state explicitly inside Update.
XML-shaped does not mean XAML-compatible.
<Window DataType="EditorViewModel"
Title="Sample"
Width="800" Height="600">
<StackPanel>
<TextBox Text="$DataContext.Name:TwoWay" />
<TextBlock Text="Hello, $DataContext.Name" />
<Button Name="SaveButton"
Click="OnSave">Save</Button>
</StackPanel>
</Window>
.crn is an AdditionalFile consumed by a Roslyn source generator that emits typed partial C#.Different.xaml.cs supplies code-behind.A matching .crn.cs partial class supplies behavior and validated handlers.Close@when/@if, templates, and source-generated bindings/interpolation.ConstrainedDependency-property instincts, strongly typed machinery.
public static readonly DependencyProperty AccentProperty =
DependencyProperty.Register(
"Accent",
typeof(Brush),
typeof(StatusControl),
new FrameworkPropertyMetadata(
Brushes.Cyan,
FrameworkPropertyMetadataOptions.AffectsRender));
public static readonly UiProperty<Brush?> AccentProperty =
UiProperty<Brush?>.Register(
"Accent",
typeof(StatusControl),
new UiPropertyMetadata<Brush?>(
defaultValue: null,
options: UiPropertyOptions.AffectsRender));
Registration and metadata
Typed registration, default values, equality, validation, coercion, read-only keys, inheritance, and invalidation flags cover the core retained-property job.
Expressions and precedence
Do not assume WPF's complete expression stack, SetCurrentValue, dynamic resources, animation clocks, or exact precedence rules. Cerneala owns a smaller explicit value-source model.
Attached behavior
APIs such as Grid.SetRow exist, but they are not evidence of a general WPF-compatible attached dependency-property system.
Freezable ecosystem
There is no promise of WPF Freezable, cloning/freeze semantics, or the inheritance-context behaviors built around it.
Styles become typed Aspect resolution.
Style / Setter / Trigger / ControlTemplate / DataTemplate / DynamicResource
A mature generalized resource and styling system integrated with dependency-property expressions, theme dictionaries, template binding, visual states, and XAML tooling.
AspectPackage / AspectToken<T> / conditions / slots / ComponentTemplate / ContentTemplate
A typed design-system engine with explicit packages, variants, runtime states, token references, template slots, source-generated @when, and traceable resolution.
Style is not mechanically an Aspect. Template precedence, content projection, resource lookup, triggers, dynamic updates, and diagnostics use different contracts.Paths in markup. Types in generated code.
Binding + PropertyPath$DataContext/$element/$self paths, plus Binding<T> and BindingOperationsINotifyPropertyChangedObservableValue<T>INotifyCollectionChangedObservableList<T>, IObservableList<T>IValueConverterIValueConverter<TIn,TOut>CollectionViewSourceCollectionView<T>, SortDescription<T>ICommand, RoutedCommandICommand, ActionCommand, RoutedCommand, CommandRouterMeasure and arrange survived. The scheduler changed around them.
WPF developers can keep their natural-size, measure/arrange, logical-tree, and visual-tree instincts. They must drop the assumption that invalidation enters WPF's Dispatcher/layout manager. Cerneala snapshots phase queues and preserves same-phase deferral plus downstream same-frame work.
Cached commands, not a WPF compositor clone.
Rectangles, ellipses, lines, paths, text, images, and explicit clip commands.
Solid, linear/radial gradient, image, tile, drawing, and visual brush descriptors.
Font resolution, HarfBuzz shaping, bidi/line-break services, Skia rasterization, layout caches, caret and selection machinery.
WPF owns a mature vector composition engine and render thread. Cerneala owns backend-neutral cached intent that a host submits explicitly.
The event vocabulary is familiar. Delivery starts from a frame snapshot.
RoutedEvent identity
Owner metadata, AddOwner, typed args, CLR wrappers, AddHandler, RemoveHandler, Handled, and handledEventsToo.
Focus and navigation
Focus scopes, capture, tab navigation, keyboard activation, input bindings, command routing, and hit-test routes are retained services.
Advanced devices
Stylus, touch, manipulation, drag/drop, text composition, and InkCanvas surfaces exist, but broad WPF behavioral parity is not implied.
Full IME and rich text
Native composition completeness, multiline rich documents, clipboard command breadth, and the full WPF text-editing surface remain outside the preview contract.
State-first motion replaces storyboard-first animation.
Timelines, clocks, Storyboards, property animation and handoff behavior
Deeply integrated with dependency-property expressions and XAML resources.
MotionSpec<T>, channels, transactions, FLIP layout, presence and scroll timelines
Root-owned, frame-coordinated, state-first, reduced-motion aware, and designed to keep render-only motion out of measure/arrange queues.
A serious core, not the complete WPF catalog.
A public type with a familiar name is not proof of full WPF behavior. The current ComboBox has a retained in-root overlay, editable text mode, WPF-style prefix autocomplete, opt-in filtering with fuzzy ranking, transactional selection, adaptive placement, and drop-down events, but does not claim native-popup parity. InkCanvas does not imply WPF erasing, gesture, or stroke-selection parity.
Backend-neutral architecture, Windows-targeted snapshot.
The current project and WindowsDX dependency make this snapshot Windows-targeted.
WindowApplicationRuntime and MonoGameUiHost converge on the retained root and backend contracts.
Clipboard, cursor, file dialogs, DPI, text input, and accessibility are exposed through platform interfaces.
A platform-neutral semantics tree and automation peers exist. Native accessibility adapter completion is still deferred.
Tree dumpers, invalidation traces, layout/render/input counters, Aspect traces, motion traces, and cache diagnostics.
No Blend/Visual Studio XAML designer parity, mature property browser, or WPF Live Visual Tree integration.
Port intent. Do not transliterate syntax.
- 01Inventory the WPF dependency surface.
Separate controls, custom properties, bindings, resources, templates, routed events, commands, animations, native interop, documents, media, and design-time dependencies.
- 02Choose the host before porting views.
Decide between generated native windows and MonoGame integration. That choice owns startup, input collection, viewport/DPI, update, and draw.
- 03Rebuild the retained root once.
Create the tree once; mutate state afterward. Do not rebuild controls every draw call like an immediate-mode UI.
- 04Translate dependency properties deliberately.
Map invalidation and inheritance to
UiPropertyMetadata<T>. Re-evaluate precedence assumptions instead of copying flags mechanically. - 05Translate bindings into compiled paths.
Use typed
$DataContext, named-element, self, and template-part paths in markup; use observable values, lists, adapters, converters, andBindingOperationsfor programmatic composition. - 06Re-model styles as Aspect packages.
Extract semantic tokens, variants, states, slots, component templates, and content templates. Do not recreate selector soup.
- 07Move storyboards to state-first motion.
Define target state, then choose specs, channels, layout FLIP, presence, transactions, and reduced-motion behavior.
- 08Audit unsupported control families.
Replace or build missing navigation, documents, menus, data grids, rich text, media, and specialized desktop controls explicitly.
- 09Prove frame invariants.
Test the first dirty update, the unchanged no-work update, draw purity, focus routes, command state, bindings, list mutation, and render-cache reuse.
- 10Re-check this snapshot against current source.
The framework moves daily. The only safe migration plan is one that verifies each relied-upon contract at the commit being shipped.
The intimidating bit you came for.
| Area | WPF concept / API | Cerneala concept / API | Status | Contract delta |
|---|
What this snapshot can and cannot prove.
Cerneala source and dated documentation
The comparison was refreshed from the public API manifest, current source tree, Developer Preview scope, event coverage audit, compiled-binding docs, Relay docs and benchmarks, Aspect docs, motion docs, scheduler plans, and architecture notes available on 7/14/2026.
Open the API referenceInspect benchmark evidenceMicrosoft Learn
WPF claims are grounded in Microsoft's official overview and architecture documentation.
WPF overviewWPF architectureDependency propertiesRouted eventsNames are not contracts
This is a conceptual and API migration map, not a conformance test. A listed type can be experimental, narrower than WPF, or intentionally governed by different invariants.
Inspect current source