TemplateBinding
struct · ferroui-base · v0.5.0
struct TemplateBinding
A lightweight binding to a property of an element's templated parent.
A binding is a mutable reference object: it is created with
TemplateBinding::empty or TemplateBinding::new, configured
property by property (or with the chaining with_* forms) and shared
as Rc<TemplateBinding>, 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.
Members
snapshot_for_reloadconverterset_converterwith_converter_valueconverter_cultureset_converter_culturewith_converter_cultureconverter_parameterset_converter_parameterwith_converter_parametermodeset_modewith_modepropertyset_propertywith_propertyemptynewwith_converterprovide_value
snapshot_for_reload
fn snapshot_for_reload(self: &Self) -> ::std::rc::Rc<Self>
An independent description for a development transaction. Keep it only through preparation: explicit sources can own application objects.
converter
fn converter(self: &Self) -> Option<Rc<dyn IValueConverter>>
The converter to use.
set_converter
fn set_converter(self: &Self, value: Option<Rc<dyn IValueConverter>>)
with_converter_value
fn with_converter_value(self: ::std::rc::Rc<Self>, value: Option<Rc<dyn IValueConverter>>) -> ::std::rc::Rc<Self>
The chaining form of the setter.
converter_culture
fn converter_culture(self: &Self) -> Option<CultureInfo>
The culture in which to evaluate the converter. None (the
default) uses the current culture.
set_converter_culture
fn set_converter_culture(self: &Self, value: Option<CultureInfo>)
with_converter_culture
fn with_converter_culture(self: ::std::rc::Rc<Self>, value: Option<CultureInfo>) -> ::std::rc::Rc<Self>
The chaining form of the setter.
converter_parameter
fn converter_parameter(self: &Self) -> Option<BoxedValue>
A parameter to pass to the converter.
set_converter_parameter
fn set_converter_parameter(self: &Self, value: Option<BoxedValue>)
with_converter_parameter
fn with_converter_parameter(self: ::std::rc::Rc<Self>, value: Option<BoxedValue>) -> ::std::rc::Rc<Self>
The chaining form of the setter.
mode
fn mode(self: &Self) -> BindingMode
The binding mode.
set_mode
fn set_mode(self: &Self, value: BindingMode)
with_mode
fn with_mode(self: ::std::rc::Rc<Self>, value: BindingMode) -> ::std::rc::Rc<Self>
The chaining form of the setter.
property
fn property(self: &Self) -> Option<&'static FerroProperty>
The property of the templated parent being bound; None binds to
the templated parent itself.
set_property
fn set_property(self: &Self, value: Option<&'static FerroProperty>)
with_property
fn with_property(self: ::std::rc::Rc<Self>, value: Option<&'static FerroProperty>) -> ::std::rc::Rc<Self>
The chaining form of the setter.
empty
fn empty() -> Rc<Self>
Creates a binding without a property (the parameterless constructor).
new
fn new(property: &'static FerroProperty) -> Rc<Self>
Creates a binding to the given property of the templated parent.
with_converter
fn with_converter(self: Rc<Self>, converter: Rc<dyn IValueConverter>) -> Rc<Self>
The chaining form of set_converter, for a
converter.
provide_value
fn provide_value(self: &Rc<Self>) -> Rc<dyn BindingBase>
The binding itself: what the markup extension form of the binding provides.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeAnyValueClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDefaultPartialEqBindingBaseMarkupTypedValueTypeRegistration
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.