# ferro_markup_list

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/macro-ferro_markup_list/

**macro** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
macro_rules! ferro_markup_list
```

Declares the notifying list of `Item` values (`FerroList<Item>`) to markup: the
counterpart of an `ObservableCollection<T>` / `IList<T>` property type of the managed
original.

```ignore
// The lists of a view model:
ferro_markup_list!(pub CursorList: Rc<StandardCursorModel>);

ferro_markup_type!(class CursorPageViewModel {
    ..
    properties: [StandardCursors: FerroList<Rc<StandardCursorModel>> { get: .. }],
});

// In the crate's `register_types()`:
CursorList::register();
```

The declaration states the element type, which is what the XAML compiler needs to
infer the data type of an item template from the collection its items control is bound
to (`[InheritDataTypeFromItems]`) and to type an indexer of a binding path. It
generates a carrier type named as given, with the markup metadata of the list (the
instantiation ``FerroList`1`` of the item type: a constructor, `Count`, `Add`, the
indexer) and `register()`, which makes the metadata known and lets bindings deliver the
list to an items source property and an indexer of a binding path follow its changes,
on every thread.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/markup_types/lists.rs#L30)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
