FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IDataTemplateComponent

    trait · ferroui-controls · v0.5.0

    trait IDataTemplateComponent
    

    The bindings of a template instance, driven by the container that hosts the instance.

    The container calls process_bindings with phase 0 when it prepares the element for an item (before it assigns the data context), then with each phase the previous call returned while it is positive, and recycle before the element is reused for another item. Phase zero reads the bindings of the elements without a phase; a later phase reads the bindings of the elements with that phase (x:Phase).

    View source

    Members

    process_bindings

    fn process_bindings(self: &Self, data: Option<BoxedValue>, item_index: i32, current_phase: i32) -> i32
    

    Reads the bindings of current_phase for data, the item at item_index (-1 when the container does not give it), and returns the next phase to process, or -1 when there is none.

    Source

    recycle

    fn recycle(self: &Self)
    

    Releases what the bindings listen to before the element is reused for another item; the elements of the later phases are hidden again until their phase.

    Source

    Availability

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