FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    builder

    module · ferroui-view · v0.5.0

    module builder
    

    The builders of elements: El, the element of a control class, its methods, and the conversions of what a setter takes (IntoProp).

    Every class gets a function that starts its element (button()) and a trait with a setter per property and a handler per routed event (ButtonProps), generated from the sources (generated/builders.rs). The setters take what converts to the value of the property: the value, a value that converts to it ("text" for an optional string, 8.0 for a thickness), a Signal or a Memo (the property follows it), a closure (computed reactively), a two-way signal, a binding, or an element for a property that holds an object (content).

    What the upstream API writes with indexers and operators on properties is here a method of the element:

    upstream C# builder
    control[Grid.RowProperty] = 1 .set(Grid::row_property(), 1) or .grid_row(1)
    control[!TextBlock.TextProperty] = binding .bind(TextBlock::text_property(), binding)
    control.Bind(Prop, observable) .text(signal), .text(move || ..)
    !! / two-way binding .text(signal.two_way())
    control.Classes.Add("accent") .class("accent")
    control.Name = "x" .name("x")

    View source

    Contents

    Availability

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