FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    AspectRatioBehavior

    struct · ferroui-xaml-interactions-responsive · v0.5.0

    struct AspectRatioBehavior
    

    Observes bounds changes of a control (or a specified source) and conditionally adds or removes classes based on AspectRatioClassSetter rules.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<AspectRatioBehavior>
    

    Returns a strong reference to this object.

    Source

    source_control_property

    fn source_control_property() -> &'static StyledProperty<Option<ElementRef<Control>>>
    

    Identifies the SourceControl property.

    Deviation (DEVIATIONS.md, Behaviors): the behavior does not own its source, so the value is an element reference.

    Source

    target_control_property

    fn target_control_property() -> &'static StyledProperty<Option<ElementRef<Control>>>
    

    Identifies the TargetControl property (an element reference, as SourceControl).

    Source

    setters_property

    fn setters_property() -> &'static DirectProperty<AspectRatioBehavior, AspectRatioClassSetters>
    

    Identifies the Setters property.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a behavior.

    Source

    source_control

    fn source_control(self: &Self) -> Option<Ref<Control>>
    

    Gets or sets the control whose bounds are observed. If not set, the associated object is used. This is a property of the object model; markup resolves a name given for it to the named control.

    Source

    set_source_control

    fn set_source_control(self: &Self, value: impl Into<Nullable<Control>>)
    

    Source

    target_control

    fn target_control(self: &Self) -> Option<Ref<Control>>
    

    Gets or sets the target control to add or remove classes from. If not set, the associated object or the target control of the setter is used. This is a property of the object model; markup resolves a name given for it to the named control.

    Source

    set_target_control

    fn set_target_control(self: &Self, value: impl Into<Nullable<Control>>)
    

    Source

    setters

    fn setters(self: &Self) -> AspectRatioClassSetters
    

    Gets aspect ratio class setters collection. This is a property of the object model, and the content of the behavior in markup.

    Source

    Trait implementations

    Availability

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