FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ferro_model

    macro · ferroui-base · v0.5.0

    macro_rules! ferro_model
    

    Declares a model type: gives it identity equality (so shared instances can travel through bindings and be stored in properties) and its binding metadata.

    ferro_model!(PersonVm, |b| b
        .notify_property_changed()
        .property::<Value<String>>("Name", |vm| vm.name(), |vm, v| vm.set_name(v))
        .read_only::<Value<i32>>("Age", |vm| vm.age())
        .method("Save", |vm, _| vm.save()));
    

    View source

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.