AbreVinci.Embryo
2.0.0
dotnet add package AbreVinci.Embryo --version 2.0.0
NuGet\Install-Package AbreVinci.Embryo -Version 2.0.0
<PackageReference Include="AbreVinci.Embryo" Version="2.0.0" />
<PackageVersion Include="AbreVinci.Embryo" Version="2.0.0" />
<PackageReference Include="AbreVinci.Embryo" />
paket add AbreVinci.Embryo --version 2.0.0
#r "nuget: AbreVinci.Embryo, 2.0.0"
#:package AbreVinci.Embryo@2.0.0
#addin nuget:?package=AbreVinci.Embryo&version=2.0.0
#tool nuget:?package=AbreVinci.Embryo&version=2.0.0
AbreVinci.Embryo
A state-driven application architecture and reactive UI framework for .NET.
Project status
Embryo is a mature framework with a relatively stable architecture and API, so it does not see the release cadence of a rapidly evolving library.
For a period, production development and the public repository diverged. After the package-signing certificate used by the original release process expired, small fixes and adaptations continued in an internal fork rather than being regularly published upstream.
Embryo continued to be used in production applications at multiple large companies throughout that period. The public repository now incorporates those accumulated fixes and extensions together with updated documentation and API cleanup.
Future changes are expected to be incremental: fixes, compatibility work, documentation, and adaptations discovered through production use rather than frequent architectural churn.
What is Embryo?
Embryo is an opinionated framework for building applications around a single immutable Application State, pure application decisions, explicit side effects, and reactive View Models.
Embryo is primarily developed and used with WPF, while the core architecture and reactive UI layer are not inherently tied to WPF.
Its central idea is:
Application State is the source of truth. Actions decide. Effects execute. View Models follow State.
Instead of distributing application behavior across mutable View Models, services, events, callbacks, and other objects that coordinate with each other, Embryo gives application behavior an explicit path through the system.
User / external input
↓
Message
↓
Action
↙ ↘
State Command
↓
Effect
↓
Message
View Models observe State and expose reactive binding surfaces to Views:
Application State
↓
View Model
↓
View
View
↓
View Model
↓
Message
The result is an architecture where Application State remains authoritative while Views can still use ordinary XAML data binding.
Why Embryo?
A conventional MVVM application can begin very simply and gradually accumulate multiple places that own or coordinate application behavior:
- mutable View Models;
- services with application state;
- events between components;
- callbacks;
- property-change chains;
- asynchronous operations that read and modify shared state;
- duplicated representations of the same application facts.
Embryo takes a different approach.
Application facts live in immutable Application State. State changes happen through pure Actions. Work that cannot happen inside a pure State transition is requested through Commands and performed by Effects. Reactive View Models adapt State to the binding surface required by each View.
This creates a strong separation between deciding what should happen, performing side effects, and presenting the current State.
Application State is authoritative
Application State contains the facts that presentation and future application decisions depend on.
State is immutable. The application moves through State snapshots rather than mutating one long-lived object:
State A → State B → State C → ...
State is not intended to mirror every mutable thing inside the process. Controls, renderers, device runtimes, caches, and other contained systems can still maintain whatever internal state they need.
Actions make application decisions
Messages enter the state machine and are routed to Actions.
Actions are pure and deterministic. Given the current State and a Message, an Action decides:
- what the next State should be;
- which Commands, if any, should be emitted.
using ActionContext = ActionContext<ApplicationState, Command>;
public static class TodoIntents
{
[Action]
public static ActionContext SetNewTodoText(this ActionContext context, string newTodoText)
{
return context.UpdateState(state => state.SetNewTodoText(newTodoText));
}
[Action]
public static ActionContext AddTodo(this ActionContext context, Guid id)
{
return context.UpdateState(state => state.AddTodo(new TodoId(id)));
}
}
State types own their valid transformations:
public record ApplicationState
{
public string NewTodoText { get; private init; }
public ApplicationState SetNewTodoText(string newTodoText)
{
if (newTodoText == NewTodoText)
return this;
return this with { NewTodoText = newTodoText };
}
}
The Action decides what should happen. The State owner implements how its State changes validly.
Effects perform side effects
Actions do not perform file I/O, make network requests, access devices, call asynchronous infrastructure, or otherwise perform side effects.
They emit Commands instead:
[Action]
public static ActionContext SaveTodos(this ActionContext context)
{
var state = context.State;
return context
.SetState(state.SetIsSaving(true))
.AddCommand(new Command.SaveTodos(state.Todos.ToImmutableArray()));
}
Effects execute those requests:
[Effect]
public static Task SaveTodos(
EffectContext<ITodoStorage, Message> context,
ImmutableArray<Todo> todos)
{
return context.ExecuteAsync(
storage => storage.SaveAsync(todos),
createOnCompletionMessage: () => new Message.OnSaveTodosComplete(),
createOnExceptionMessage: exception => new Message.OnSaveTodosFailed(exception.Message));
}
If the result matters to subsequent application behavior, it returns as another Message and is interpreted by another Action against the State that exists at that time.
Actions decide. Effects execute what Actions requested.
View Models follow State
Embryo View Models are reactive binding surfaces shaped for their Views.
They do not own another mutable copy of Application State.
public sealed class MainWindowViewModel : ReactiveViewModel
{
public MainWindowViewModel(
IObservable<ApplicationState> state,
Action<Message> dispatch)
{
TodoCount = BindOneWay(state.Select(s => s.Todos.Ids.Count));
NewTodoText = BindTwoWay(
state.Select(s => s.NewTodoText),
value => dispatch(new Message.SetNewTodoText(value)));
AddTodo = BindCommand(
() => dispatch(new Message.AddTodo(Guid.NewGuid())),
state.Select(s => s.CanAddTodo));
}
public int TodoCount { get; }
public string NewTodoText { get; set; }
public ICommand AddTodo { get; }
}
BindOneWay, BindTwoWay, collection bindings, and command bindings keep the View Model synchronized with its reactive inputs and handle the normal property and collection change notification machinery required by XAML.
The View Model remains an adapter between the application and the View rather than becoming another owner of application behavior.
Architecture
At the center of an Embryo application is the Program.
DispatchMessage
↓
┌──────────────────── Program ───────────────────┐
│ │
│ Messages ──→ Reducer ──→ Actions ──→ State │
│ ↑ │ │
│ └── State └──→ Commands │
│ │
│ State ──→ State Stream │
│ Messages ──→ Message Stream │
│ Commands ──→ Command Stream │
└────────────────────────────────────────────────┘
↓ ↓ ↓
Controllers
The main architectural pieces are:
Application State The immutable source of truth for application facts.
Message A request, result, event, or other input entering the state machine.
Action A pure application decision. It determines the next State and may emit Commands.
Command An immutable request for work that cannot happen inside a pure State transition.
Effect Performs the work requested by a Command and may dispatch response Messages.
Program Owns current Application State, processes Messages, and exposes State, Message, and Command streams.
Controller Owns an ongoing relationship with the application or an external event source. Controllers may observe State or Program activity and dispatch Messages over their lifetime.
View Model A reactive binding surface shaped for one View.
The source generator can generate Message and Command types, Reducer routing, and CommandHandler routing from Actions and Effects, leaving feature code focused on application decisions and execution.
Packages
The repository is split into several packages with different responsibilities.
| Package | Purpose |
|---|---|
AbreVinci.Embryo |
Main package combining the application, core, and reactive UI layers |
AbreVinci.Embryo.Core |
Core types such as ActionContext and EffectContext |
AbreVinci.Embryo.App |
The Program state machine and application-level infrastructure |
AbreVinci.Embryo.ReactiveUI |
Reactive View Models, bindings, collections, commands, and UI infrastructure |
AbreVinci.Embryo.WPF |
WPF-specific windowing and integration |
AbreVinci.Embryo.Generator |
Source generation for Messages, Commands, Reducers, and CommandHandlers |
AbreVinci.Embryo.Fody |
IL weaving used by the reactive View Model binding infrastructure |
The projects currently target .NET 8, with AbreVinci.Embryo.WPF targeting .NET 8 for Windows.
Documentation
There are two complementary guides to Embryo.
Embryo for Dummies
Start here if Embryo is new to you.
Embryo for Dummies builds a small application one requirement at a time and introduces the architecture only as each part becomes useful.
It assumes ordinary C#, XAML, and MVVM knowledge. It does not assume prior knowledge of functional programming, Redux, MVU, ReactiveX, or immutable application architectures.
The Embryo Playbook
Use the Playbook when you already understand the basic mechanics and want to design real Embryo applications well.
It covers topics including:
- State modeling and invariants;
- identity and normalized immutable State;
- State transformations;
- Actions, Effects, and Intent Chains;
- Controllers and ongoing responsibilities;
- reactive State selection;
- View Model composition;
- XAML and View boundaries;
- application boundaries and integration with stateful subsystems.
TodoApp sample
The complete source code of the application built throughout Embryo for Dummies, split into projects the way a real Embryo application would be, including a behavioral test suite that exercises the application through its View Models.
The README is intentionally only an overview. The books are where the architecture and its practical design guidance are developed properly.
API direction and deprecations
The preferred ActionContext<TState, TCommand> APIs are:
context.SetState(state);
context.UpdateState(state => state.SetSomething(...));
context.AddCommand(command);
context.AddCommands(commands);
The older APIs are deprecated:
WithState
WithCommand
WithCommands
Background
Embryo grew from ideas found in functional application architectures such as Elm and Redux while retaining View Models and XAML data binding.
Older material may describe this combination as MVVMU.
The terminology is less important than the responsibilities themselves:
- immutable Application State;
- Messages as inputs;
- pure Actions for application decisions;
- Commands and Effects for execution;
- reactive View Models for presentation;
- Controllers for ongoing relationships.
License
See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- AbreVinci.Embryo.App (>= 2.0.0)
- AbreVinci.Embryo.Core (>= 2.0.0)
- AbreVinci.Embryo.ReactiveUI (>= 2.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on AbreVinci.Embryo:
| Package | Downloads |
|---|---|
|
AbreVinci.Embryo.WPF
WPF integration for AbreVinci.Embryo, providing windowing and application infrastructure for building state-driven WPF applications with reactive View Models. |
|
|
AbreVinci.Embryo.Debugging
Time travel and log debuggers for the AbreVinci.Embryo (MVVM+MVU/MVVMU) framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 91 | 11/11/2026 |
| 2.0.0-beta0003 | 154 | 10/2/2026 |
| 1.7.0 | 1,513 | 9/2/2022 |
| 1.6.0 | 1,436 | 2/8/2022 |
| 1.5.0 | 1,418 | 1/30/2022 |
| 1.4.1 | 729 | 1/22/2022 |
| 1.4.0 | 663 | 1/22/2022 |
| 1.4.0-beta0000 | 401 | 1/22/2022 |
| 1.3.0 | 508 | 1/9/2022 |
| 1.2.2 | 533 | 12/5/2021 |
| 1.2.1 | 511 | 12/3/2021 |
| 1.2.0 | 3,696 | 11/25/2021 |