# moonrockz/dependency-object

Dependency objects for MoonBit: objects whose property values the library stores and resolves, with default values,
coercion, change notification and value inheritance, as `DependencyObject` in WPF, `BindableObject` in .NET MAUI and
`AvaloniaObject` in Avalonia. Elements also have routed events, and property paths such as `Child.Width` read, set and observe
values, both as in WPF.

Add it with `moon add moonrockz/dependency-object`. While the version is 0.x, a minor release can have breaking changes.

You can register types and properties, set, coerce and observe values, build
trees of elements, inherit values in them, raise events that go through them and follow property paths. The
specifications are in `openspec/specs/` of the repository.

| Package | Purpose |
| --- | --- |
| `moonrockz/dependency-object` | [Types, properties, objects and their values](src/README.mbt.md), and `version()` |
| `moonrockz/dependency-object/events` | [Routed events](src/events/README.mbt.md) of these types |
| `moonrockz/dependency-object/path` | [Property paths](src/path/README.mbt.md), as WPF's `PropertyPath` |

The module does not depend on `moonrockz/xaml`. You can use it without XAML. It targets wasm, wasm-gc, js and native.
