Skip to main content

Module model

Module model 

Source
Expand description

The model layer: what bindings need from data that is not part of the class hierarchy (view models, plain data, collections, commands).

The managed runtime discovers these capabilities through reflection and interface casts on arbitrary objects. Here a model type states them once: it implements the notification traits it supports and declares its bindable properties and methods (see ferro_model! and ModelTypeBuilder). Compiled bindings do not need the declaration: they are built from typed accessor closures.

Re-exports§

pub use crate::input::ICommand;

Structs§

BindableArray
An array that bindings can index into: one or more dimensions of fixed lengths, stored in row-major order.
BindableDictionary
A notifying dictionary that bindings can index into (Items[key]): a FerroDictionary together with the untyped change event that binding indexers subscribe to.
BindableList
A notifying list that bindings can index into: a FerroList together with the untyped change event that binding indexers subscribe to.
CollectionChange
An untyped description of a change to a collection, as seen by bindings with an indexer in their path.
Event
A multicast event of a model object: the equivalent of a managed event member on a type that is not part of the class hierarchy.
ModelMethod
A method of a model type that bindings can turn into a command.
ModelType
The binding metadata of a model type: a type outside the class hierarchy (typically a view model) that bindings with a string path can navigate.
ModelTypeBuilder
Declares the binding metadata of model type T.
ModelTypes
The per-thread table of model type metadata.

Traits§

IBindableArray
Untyped access to an array: a fixed-size collection accessed with integer indexes, one per dimension.
IBindableIndexer
The untyped form of an indexer (this[..]), for bindings with an indexer in their path (Items[key], Grid[1,2]).
IBindableList
Untyped indexed access to a list, for bindings with an indexer in their path (Items[2]).
INotifyCollectionChanged
Notifies clients of changes to a collection, such as when items are added and removed or the whole collection is reset.
INotifyDataErrorInfo
Lets a model object report validation errors for its properties (synchronously or asynchronously).
INotifyPropertyChanged
Notifies clients that a property value of a model object (an object that is not part of the class hierarchy, such as a view model) has changed.
Model
A model type that declares its binding metadata.