FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IValueConverter

    trait · ferroui-base · v0.5.0

    trait IValueConverter
    

    Converts a binding value.

    Values are untyped: None is null, and a converter may return the unset marker (FerroProperty::unset_value) to make the binding use its fallback value, the do-nothing marker (BindingOperations::do_nothing) to leave the target untouched, or a boxed BindingNotification to report an error. Returning Err is the equivalent of throwing from the converter: the binding logs the error and treats the value as unset.

    culture is the culture to use: the converter culture of the binding, or the current culture when the binding names none.

    View source

    Members

    convert

    fn convert(self: &Self, value: Option<&BoxedValue>, target_type: ValueType, parameter: Option<&BoxedValue>, culture: &CultureInfo) -> Result<Option<BoxedValue>, BindingError>
    

    Converts a value on its way from the binding source to the target.

    Source

    convert_back

    fn convert_back(self: &Self, value: Option<&BoxedValue>, target_type: ValueType, parameter: Option<&BoxedValue>, culture: &CultureInfo) -> Result<Option<BoxedValue>, BindingError>
    

    Converts a value on its way from the binding target to the source.

    Source

    Trait implementations

    Availability

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