pub struct ReflectionBinding { /* private fields */ }Expand description
A binding whose path is text, resolved at run time against the metadata that the objects along the path declared: registered properties for objects of the class hierarchy, declared model metadata for everything else.
A binding is a mutable reference object: it is created with
ReflectionBinding::empty or ReflectionBinding::new, configured
property by property (or with the chaining with_* forms) and shared
as Rc<ReflectionBinding>, which converts to Rc<dyn BindingBase>.
Handles compare by identity. The properties are read when the binding
is instantiated on a target: changing them afterwards affects later
instances only.
Implementations§
Source§impl ReflectionBinding
impl ReflectionBinding
Sourcepub fn converter(&self) -> Option<Rc<dyn IValueConverter>>
pub fn converter(&self) -> Option<Rc<dyn IValueConverter>>
The converter to use.
pub fn set_converter(&self, value: Option<Rc<dyn IValueConverter>>)
Sourcepub fn with_converter_value(
self: Rc<Self>,
value: Option<Rc<dyn IValueConverter>>,
) -> Rc<Self>
pub fn with_converter_value( self: Rc<Self>, value: Option<Rc<dyn IValueConverter>>, ) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn converter_culture(&self) -> Option<CultureInfo>
pub fn converter_culture(&self) -> Option<CultureInfo>
The culture in which to evaluate the converter. None (the
default) uses the current culture.
pub fn set_converter_culture(&self, value: Option<CultureInfo>)
Sourcepub fn with_converter_culture(
self: Rc<Self>,
value: Option<CultureInfo>,
) -> Rc<Self>
pub fn with_converter_culture( self: Rc<Self>, value: Option<CultureInfo>, ) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn converter_parameter(&self) -> Option<BoxedValue>
pub fn converter_parameter(&self) -> Option<BoxedValue>
A parameter to pass to the converter.
pub fn set_converter_parameter(&self, value: Option<BoxedValue>)
Sourcepub fn with_converter_parameter(
self: Rc<Self>,
value: Option<BoxedValue>,
) -> Rc<Self>
pub fn with_converter_parameter( self: Rc<Self>, value: Option<BoxedValue>, ) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn delay(&self) -> i32
pub fn delay(&self) -> i32
The amount of time, in milliseconds, to wait before updating the binding source after the value on the target changes.
pub fn set_delay(&self, value: i32)
Sourcepub fn with_delay(self: Rc<Self>, value: i32) -> Rc<Self>
pub fn with_delay(self: Rc<Self>, value: i32) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn element_name(&self) -> Option<String>
pub fn element_name(&self) -> Option<String>
The name of the element to use as the binding source.
pub fn set_element_name(&self, value: Option<String>)
Sourcepub fn with_element_name(self: Rc<Self>, value: Option<String>) -> Rc<Self>
pub fn with_element_name(self: Rc<Self>, value: Option<String>) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn fallback_value(&self) -> Option<BoxedValue>
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.
pub fn set_fallback_value(&self, value: Option<BoxedValue>)
Sourcepub fn with_fallback_value(
self: Rc<Self>,
value: Option<BoxedValue>,
) -> Rc<Self>
pub fn with_fallback_value( self: Rc<Self>, value: Option<BoxedValue>, ) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn mode(&self) -> BindingMode
pub fn mode(&self) -> BindingMode
The binding mode.
pub fn set_mode(&self, value: BindingMode)
Sourcepub fn with_mode(self: Rc<Self>, value: BindingMode) -> Rc<Self>
pub fn with_mode(self: Rc<Self>, value: BindingMode) -> Rc<Self>
The chaining form of the setter.
pub fn set_path(&self, value: String)
Sourcepub fn priority(&self) -> BindingPriority
pub fn priority(&self) -> BindingPriority
The binding priority.
pub fn set_priority(&self, value: BindingPriority)
Sourcepub fn with_priority(self: Rc<Self>, value: BindingPriority) -> Rc<Self>
pub fn with_priority(self: Rc<Self>, value: BindingPriority) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn relative_source(&self) -> Option<Rc<RelativeSource>>
pub fn relative_source(&self) -> Option<Rc<RelativeSource>>
The relative source for the binding.
pub fn set_relative_source(&self, value: Option<Rc<RelativeSource>>)
Sourcepub fn with_relative_source(
self: Rc<Self>,
value: Option<Rc<RelativeSource>>,
) -> Rc<Self>
pub fn with_relative_source( self: Rc<Self>, value: Option<Rc<RelativeSource>>, ) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn source(&self) -> Option<BoxedValue>
pub fn source(&self) -> Option<BoxedValue>
The source for the binding; the unset marker (the default) for none.
pub fn set_source(&self, value: Option<BoxedValue>)
Sourcepub fn with_source(self: Rc<Self>, value: Option<BoxedValue>) -> Rc<Self>
pub fn with_source(self: Rc<Self>, value: Option<BoxedValue>) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn string_format(&self) -> Option<String>
pub fn string_format(&self) -> Option<String>
The string format.
pub fn set_string_format(&self, value: Option<String>)
Sourcepub fn with_string_format(self: Rc<Self>, value: Option<String>) -> Rc<Self>
pub fn with_string_format(self: Rc<Self>, value: Option<String>) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn target_null_value(&self) -> Option<BoxedValue>
pub fn target_null_value(&self) -> Option<BoxedValue>
The value to use when the binding produces null; the unset marker for none.
pub fn set_target_null_value(&self, value: Option<BoxedValue>)
Sourcepub fn with_target_null_value(
self: Rc<Self>,
value: Option<BoxedValue>,
) -> Rc<Self>
pub fn with_target_null_value( self: Rc<Self>, value: Option<BoxedValue>, ) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn update_source_trigger(&self) -> UpdateSourceTrigger
pub fn update_source_trigger(&self) -> UpdateSourceTrigger
What triggers updates of the binding source in two-way and one-way-to-source bindings.
pub fn set_update_source_trigger(&self, value: UpdateSourceTrigger)
Sourcepub fn with_update_source_trigger(
self: Rc<Self>,
value: UpdateSourceTrigger,
) -> Rc<Self>
pub fn with_update_source_trigger( self: Rc<Self>, value: UpdateSourceTrigger, ) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn type_resolver(&self) -> Option<TypeResolver>
pub fn type_resolver(&self) -> Option<TypeResolver>
Resolves the type names in the path (casts, attached properties, ancestor types).
pub fn set_type_resolver(&self, value: Option<TypeResolver>)
Sourcepub fn with_type_resolver(
self: Rc<Self>,
value: Option<TypeResolver>,
) -> Rc<Self>
pub fn with_type_resolver( self: Rc<Self>, value: Option<TypeResolver>, ) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn default_anchor(&self) -> Option<WeakRef<FerroObject>>
pub fn default_anchor(&self) -> Option<WeakRef<FerroObject>>
The anchor to use if the target is not an element.
pub fn set_default_anchor(&self, value: Option<WeakRef<FerroObject>>)
Sourcepub fn with_default_anchor(
self: Rc<Self>,
value: Option<WeakRef<FerroObject>>,
) -> Rc<Self>
pub fn with_default_anchor( self: Rc<Self>, value: Option<WeakRef<FerroObject>>, ) -> Rc<Self>
The chaining form of the setter.
Sourcepub fn name_scope(&self) -> Option<Weak<dyn INameScope>>
pub fn name_scope(&self) -> Option<Weak<dyn INameScope>>
The name scope in which named elements are looked up.
pub fn set_name_scope(&self, value: Option<Weak<dyn INameScope>>)
Sourcepub fn with_name_scope(
self: Rc<Self>,
value: Option<Weak<dyn INameScope>>,
) -> Rc<Self>
pub fn with_name_scope( self: Rc<Self>, value: Option<Weak<dyn INameScope>>, ) -> Rc<Self>
The chaining form of the setter.
Source§impl ReflectionBinding
impl ReflectionBinding
Sourcepub fn construct(path: &str) -> Self
pub fn construct(path: &str) -> Self
The class data of a binding with the given path, for a type that derives from this one.
Sourcepub fn with_converter(
self: Rc<Self>,
converter: Rc<dyn IValueConverter>,
) -> Rc<Self>
pub fn with_converter( self: Rc<Self>, converter: Rc<dyn IValueConverter>, ) -> Rc<Self>
The chaining form of set_converter, for a
converter.
Sourcepub fn try_create_instance(
&self,
target: &FerroObject,
target_property: Option<&'static FerroProperty>,
anchor: Option<&Ref<FerroObject>>,
) -> Result<Rc<BindingExpression>, ExpressionParseException>
pub fn try_create_instance( &self, target: &FerroObject, target_property: Option<&'static FerroProperty>, anchor: Option<&Ref<FerroObject>>, ) -> Result<Rc<BindingExpression>, ExpressionParseException>
Instantiates the binding, reporting a malformed path as an error instead of panicking.
Trait Implementations§
Source§impl BindingBase for ReflectionBinding
impl BindingBase for ReflectionBinding
Source§fn create_instance(
&self,
target: &FerroObject,
target_property: Option<&'static FerroProperty>,
anchor: Option<&Ref<FerroObject>>,
) -> Rc<dyn BindingExpressionBase>
fn create_instance( &self, target: &FerroObject, target_property: Option<&'static FerroProperty>, anchor: Option<&Ref<FerroObject>>, ) -> Rc<dyn BindingExpressionBase>
Panics if the path is malformed (a programmer error, as in the
managed implementation); use
try_create_instance for
paths that come from user input.
Source§impl Default for ReflectionBinding
impl Default for ReflectionBinding
Source§impl MarkupTyped for ReflectionBinding
impl MarkupTyped for ReflectionBinding
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl !Freeze for ReflectionBinding
impl !RefUnwindSafe for ReflectionBinding
impl !Send for ReflectionBinding
impl !Sync for ReflectionBinding
impl !UnwindSafe for ReflectionBinding
impl Unpin for ReflectionBinding
impl UnsafeUnpin for ReflectionBinding
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more