pub struct TemplateBinding { /* private fields */ }Expand description
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.
Implementations§
Source§impl TemplateBinding
impl TemplateBinding
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 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.
Sourcepub fn property(&self) -> Option<&'static FerroProperty>
pub fn property(&self) -> Option<&'static FerroProperty>
The property of the templated parent being bound; None binds to
the templated parent itself.
pub fn set_property(&self, value: Option<&'static FerroProperty>)
Sourcepub fn with_property(
self: Rc<Self>,
value: Option<&'static FerroProperty>,
) -> Rc<Self>
pub fn with_property( self: Rc<Self>, value: Option<&'static FerroProperty>, ) -> Rc<Self>
The chaining form of the setter.
Source§impl TemplateBinding
impl TemplateBinding
Sourcepub fn empty() -> Rc<Self>
pub fn empty() -> Rc<Self>
Creates a binding without a property (the parameterless constructor).
Sourcepub fn new(property: &'static FerroProperty) -> Rc<Self>
pub fn new(property: &'static FerroProperty) -> Rc<Self>
Creates a binding to the given property of the templated parent.
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 provide_value(self: &Rc<Self>) -> Rc<dyn BindingBase>
pub fn provide_value(self: &Rc<Self>) -> Rc<dyn BindingBase>
The binding itself: what the markup extension form of the binding provides.
Trait Implementations§
Source§impl BindingBase for TemplateBinding
impl BindingBase for TemplateBinding
Source§fn as_any(&self) -> Option<&dyn Any>
fn as_any(&self) -> Option<&dyn Any>
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>
fn create_instance( &self, _target: &FerroObject, _target_property: Option<&'static FerroProperty>, _anchor: Option<&Ref<FerroObject>>, ) -> Rc<dyn BindingExpressionBase>
Source§impl Default for TemplateBinding
impl Default for TemplateBinding
Source§impl MarkupTyped for TemplateBinding
impl MarkupTyped for TemplateBinding
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl !Freeze for TemplateBinding
impl !RefUnwindSafe for TemplateBinding
impl !Send for TemplateBinding
impl !Sync for TemplateBinding
impl !UnwindSafe for TemplateBinding
impl Unpin for TemplateBinding
impl UnsafeUnpin for TemplateBinding
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