Skip to main content

MultiBinding

Struct MultiBinding 

Source
pub struct MultiBinding { /* private fields */ }
Expand description

A binding that aggregates multiple bindings through a converter.

A binding is a mutable reference object: it is created with MultiBinding::new, configured property by property (or with the chaining with_* forms) and shared as Rc<MultiBinding>, which converts to Rc<dyn BindingBase>. Handles compare by identity. The properties, and the contents of the collection of child bindings, are read when the binding is instantiated on a target: changing them afterwards affects later instances only.

Implementations§

Source§

impl MultiBinding

Source

pub fn bindings(&self) -> FerroList<Rc<dyn BindingBase>>

The collection of child bindings. The list is a shared handle: children are added to the list the getter returns.

Source

pub fn set_bindings(&self, value: FerroList<Rc<dyn BindingBase>>)

Source

pub fn with_bindings_list( self: Rc<Self>, value: FerroList<Rc<dyn BindingBase>>, ) -> Rc<Self>

The chaining form of the setter.

Source

pub fn converter(&self) -> Option<Rc<dyn IMultiValueConverter>>

The converter to use.

Source

pub fn set_converter(&self, value: Option<Rc<dyn IMultiValueConverter>>)

Source

pub fn with_converter_value( self: Rc<Self>, value: Option<Rc<dyn IMultiValueConverter>>, ) -> Rc<Self>

The chaining form of the setter.

Source

pub fn converter_culture(&self) -> Option<CultureInfo>

The culture in which to evaluate the converter. None (the default) uses the current culture.

Source

pub fn set_converter_culture(&self, value: Option<CultureInfo>)

Source

pub fn with_converter_culture( self: Rc<Self>, value: Option<CultureInfo>, ) -> Rc<Self>

The chaining form of the setter.

Source

pub fn converter_parameter(&self) -> Option<BoxedValue>

A parameter to pass to the converter.

Source

pub fn set_converter_parameter(&self, value: Option<BoxedValue>)

Source

pub fn with_converter_parameter( self: Rc<Self>, value: Option<BoxedValue>, ) -> Rc<Self>

The chaining form of the setter.

Source

pub fn fallback_value(&self) -> Option<BoxedValue>

The value to use when the binding is unable to produce a value; the unset marker for none.

Source

pub fn set_fallback_value(&self, value: Option<BoxedValue>)

Source

pub fn with_fallback_value( self: Rc<Self>, value: Option<BoxedValue>, ) -> Rc<Self>

The chaining form of the setter.

Source

pub fn mode(&self) -> BindingMode

The binding mode. Only one-time and one-way are supported.

Source

pub fn set_mode(&self, value: BindingMode)

Source

pub fn with_mode(self: Rc<Self>, value: BindingMode) -> Rc<Self>

The chaining form of the setter.

Source

pub fn priority(&self) -> BindingPriority

The binding priority.

Source

pub fn set_priority(&self, value: BindingPriority)

Source

pub fn with_priority(self: Rc<Self>, value: BindingPriority) -> Rc<Self>

The chaining form of the setter.

Source

pub fn relative_source(&self) -> Option<Rc<RelativeSource>>

The relative source for the binding.

Source

pub fn set_relative_source(&self, value: Option<Rc<RelativeSource>>)

Source

pub fn with_relative_source( self: Rc<Self>, value: Option<Rc<RelativeSource>>, ) -> Rc<Self>

The chaining form of the setter.

Source

pub fn string_format(&self) -> Option<String>

The string format.

Source

pub fn set_string_format(&self, value: Option<String>)

Source

pub fn with_string_format(self: Rc<Self>, value: Option<String>) -> Rc<Self>

The chaining form of the setter.

Source

pub fn target_null_value(&self) -> Option<BoxedValue>

The value to use when the binding produces null; the unset marker for none.

Source

pub fn set_target_null_value(&self, value: Option<BoxedValue>)

Source

pub fn with_target_null_value( self: Rc<Self>, value: Option<BoxedValue>, ) -> Rc<Self>

The chaining form of the setter.

Source§

impl MultiBinding

Source

pub fn new() -> Rc<Self>

Creates a multi-binding without child bindings.

Source

pub fn with_bindings( self: Rc<Self>, bindings: Vec<Rc<dyn BindingBase>>, ) -> Rc<Self>

The chaining form of adding child bindings: replaces the contents of the collection of child bindings.

Source

pub fn with_converter( self: Rc<Self>, converter: Rc<dyn IMultiValueConverter>, ) -> Rc<Self>

The chaining form of set_converter, for a converter.

Trait Implementations§

Source§

impl BindingBase for MultiBinding

Source§

fn as_any(&self) -> Option<&dyn Any>

The implementing value, for casting to its concrete type (as_any()?.downcast_ref::<T>()): the equivalent of is/as on the contract. None for an implementation that does not expose itself.
Source§

fn create_instance( &self, _target: &FerroObject, target_property: Option<&'static FerroProperty>, _anchor: Option<&Ref<FerroObject>>, ) -> Rc<dyn BindingExpressionBase>

Creates a binding expression from the binding. Read more
Source§

impl Default for MultiBinding

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl MarkupTyped for MultiBinding

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl PartialEq for MultiBinding

Compares by identity (reference equality), as the reference type this mirrors.

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.