pub struct EffectTransition { /* private fields */ }Expand description
Transition class that handles effect properties.
Blur effects transition to and from blur effects, drop shadows to and from drop shadows; a missing effect stands for an effect of the other value’s kind that has no visible result.
Implementations§
Source§impl EffectTransition
impl EffectTransition
pub fn new() -> Ref<Self>
Sourcepub fn with_property(
property: &'static FerroProperty,
duration: TimeSpan,
) -> Ref<Self>
pub fn with_property( property: &'static FerroProperty, duration: TimeSpan, ) -> Ref<Self>
Creates a transition of property that takes duration.
Methods from Deref<Target = TransitionBase>§
Sourcepub fn to_ref(&self) -> Ref<TransitionBase>
pub fn to_ref(&self) -> Ref<TransitionBase>
Returns a strong reference to this object.
Sourcepub fn apply(
&self,
control: &Animatable,
clock: Rc<dyn IClock>,
old_value: &BoxedValue,
new_value: &BoxedValue,
) -> Rc<dyn IDisposable>
pub fn apply( &self, control: &Animatable, clock: Rc<dyn IClock>, old_value: &BoxedValue, new_value: &BoxedValue, ) -> Rc<dyn IDisposable>
Applies the transition to control: animates the transition’s
property from old_value to new_value.
Sourcepub fn value_type(&self) -> (TypeId, &'static str)
pub fn value_type(&self) -> (TypeId, &'static str)
The type of the values the transition animates, which the value type of its property has to match.
pub fn set_duration(&self, value: TimeSpan)
pub fn set_delay(&self, value: TimeSpan)
pub fn set_easing(&self, value: impl Into<Easing>)
Sourcepub fn property(&self) -> Option<&'static FerroProperty>
pub fn property(&self) -> Option<&'static FerroProperty>
The property to be animated.
pub fn set_property(&self, value: Option<&'static FerroProperty>)
Sourcepub fn debug_display(&self) -> String
pub fn debug_display(&self) -> String
A description of the transition for diagnostics.
Methods from Deref<Target = FerroObject>§
Sourcepub fn dispatcher(&self) -> &Arc<Dispatcher> ⓘ
pub fn dispatcher(&self) -> &Arc<Dispatcher> ⓘ
Returns the Dispatcher that this object is associated with: the
dispatcher of the thread that owns the object.
Sourcepub fn check_access(&self) -> bool
pub fn check_access(&self) -> bool
Returns whether the calling thread is the thread that owns this object.
Sourcepub fn verify_access(&self)
pub fn verify_access(&self)
Sourcepub fn to_ref(&self) -> Ref<FerroObject>
pub fn to_ref(&self) -> Ref<FerroObject>
A strong reference to this object.
Sourcepub fn to_weak(&self) -> WeakRef<FerroObject>
pub fn to_weak(&self) -> WeakRef<FerroObject>
A weak reference to this object.
Sourcepub fn is<T: ObjectType>(&self) -> bool
pub fn is<T: ObjectType>(&self) -> bool
Whether the object is of class T or a class derived from it.
Sourcepub fn downcast_ref<T: ObjectType>(&self) -> Option<&T>
pub fn downcast_ref<T: ObjectType>(&self) -> Option<&T>
Returns the object viewed as class T if it is one.
Sourcepub fn on_property_changed(&self, change: &FerroPropertyChangedEventArgs<'_>)
pub fn on_property_changed(&self, change: &FerroPropertyChangedEventArgs<'_>)
Invokes the on_property_changed virtual member.
Sourcepub fn inheritance_parent(&self) -> Option<Ref<FerroObject>>
pub fn inheritance_parent(&self) -> Option<Ref<FerroObject>>
The parent object that inherited property values are inherited from.
Sourcepub fn set_inheritance_parent(&self, value: impl Into<Nullable<FerroObject>>)
pub fn set_inheritance_parent(&self, value: impl Into<Nullable<FerroObject>>)
Sets the parent object that inherited property values are inherited from.
Sourcepub fn clear_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
)
pub fn clear_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, )
Clears a property’s local value.
Sourcepub fn get_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
) -> T
pub fn get_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, ) -> T
Gets a property value.
Sourcepub fn get_base_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
) -> Option<T>
pub fn get_base_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, ) -> Option<T>
Gets a property’s base value: the value excluding animated values.
Returns None if the value comes from inheritance or the default.
Sourcepub fn is_animating(&self, property: &FerroProperty) -> bool
pub fn is_animating(&self, property: &FerroProperty) -> bool
Checks whether a property is animating.
Sourcepub fn is_set(&self, property: &FerroProperty) -> bool
pub fn is_set(&self, property: &FerroProperty) -> bool
Checks whether a styled property has a value assigned to it or a binding targeting it.
Sourcepub fn set_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
value: T,
)
pub fn set_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, value: T, )
Sets a property value with local value priority.
Sourcepub fn set_value_with_priority<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
value: T,
priority: BindingPriority,
) -> Option<Rc<dyn IDisposable>>
pub fn set_value_with_priority<T: PropertyValue>( &self, property: &'static StyledProperty<T>, value: T, priority: BindingPriority, ) -> Option<Rc<dyn IDisposable>>
Sets a property value with the given priority. For priorities other than local value, disposing the returned handle removes the value.
Sourcepub fn set_current_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
value: T,
)
pub fn set_current_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, value: T, )
Sets the value of a property without changing its value source.
This is used by a component that programmatically sets the value of one of its own properties without disabling an application’s declared use of the property: the effective value changes, but existing bindings and styles continue to work. The new value has the property’s current priority.
Sourcepub fn bind_binding(
&self,
property: &'static FerroProperty,
binding: &dyn BindingBase,
) -> Rc<dyn BindingExpressionBase>
pub fn bind_binding( &self, property: &'static FerroProperty, binding: &dyn BindingBase, ) -> Rc<dyn BindingExpressionBase>
Binds a property to a binding. Returns the binding expression which represents the binding instance on this object.
Sourcepub fn bind_binding_with_anchor(
&self,
property: &'static FerroProperty,
binding: &dyn BindingBase,
anchor: Option<&Ref<FerroObject>>,
) -> Rc<dyn BindingExpressionBase>
pub fn bind_binding_with_anchor( &self, property: &'static FerroProperty, binding: &dyn BindingBase, anchor: Option<&Ref<FerroObject>>, ) -> Rc<dyn BindingExpressionBase>
Binds a property to a binding.
Some bindings need context to locate their source: a data context,
named elements or resources. If this object is not an element, or is
not yet attached to the tree, anchor provides that context.
Sourcepub fn indexer(&self, binding: &IndexerDescriptor) -> IndexerBinding
pub fn indexer(&self, binding: &IndexerDescriptor) -> IndexerBinding
Gets a binding to a property of this object: the indexer taking an
IndexerDescriptor
(source[!Property] is source.indexer(&Property.bind())).
Sourcepub fn bind_indexer(
&self,
binding: &IndexerDescriptor,
value: &dyn BindingBase,
) -> Rc<dyn BindingExpressionBase>
pub fn bind_indexer( &self, binding: &IndexerDescriptor, value: &dyn BindingBase, ) -> Rc<dyn BindingExpressionBase>
Binds the property of an
IndexerDescriptor to a binding:
the setter of the indexer (target[!Property] = binding is
target.bind_indexer(&Property.bind(), &binding)).
Sourcepub fn bind<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<T>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>
pub fn bind<T: PropertyValue>( &self, property: &'static StyledProperty<T>, source: Rc<dyn IObservable<T>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
Binds a property to an observable.
Sourcepub fn bind_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<BindingValue<T>>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>
pub fn bind_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, source: Rc<dyn IObservable<BindingValue<T>>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
Binds a property to an observable of binding values.
Sourcepub fn bind_untyped<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<BoxedValue>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>
pub fn bind_untyped<T: PropertyValue>( &self, property: &'static StyledProperty<T>, source: Rc<dyn IObservable<BoxedValue>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
Binds a property to an observable of untyped values.
Sourcepub fn coerce_value(&self, property: &'static FerroProperty)
pub fn coerce_value(&self, property: &'static FerroProperty)
Coerces the specified property.
Sourcepub fn get_direct_value<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
) -> T
pub fn get_direct_value<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, ) -> T
Gets a direct property value.
Sourcepub fn set_direct_value<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
value: T,
)
pub fn set_direct_value<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, value: T, )
Sets a direct property value.
Sourcepub fn clear_direct_value<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
)
pub fn clear_direct_value<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, )
Resets a direct property to its unset value.
Sourcepub fn bind_direct<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<T>>,
) -> Rc<dyn IDisposable>
pub fn bind_direct<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, source: Rc<dyn IObservable<T>>, ) -> Rc<dyn IDisposable>
Binds a direct property to an observable.
Sourcepub fn bind_direct_value<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<BindingValue<T>>>,
) -> Rc<dyn IDisposable>
pub fn bind_direct_value<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, source: Rc<dyn IObservable<BindingValue<T>>>, ) -> Rc<dyn IDisposable>
Binds a direct property to an observable of binding values.
Sourcepub fn bind_direct_untyped<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<BoxedValue>>,
) -> Rc<dyn IDisposable>
pub fn bind_direct_untyped<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, source: Rc<dyn IObservable<BoxedValue>>, ) -> Rc<dyn IDisposable>
Binds a direct property to an observable of untyped values.
Sourcepub fn set_and_raise<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
field: &RefCell<T>,
value: T,
) -> bool
pub fn set_and_raise<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, field: &RefCell<T>, value: T, ) -> bool
Sets the backing field of a direct property, raising a change notification if the value changed. Returns true if it changed.
Sourcepub fn set_and_raise_cell<T: PropertyValue + Copy>(
&self,
property: &'static DirectPropertyBase<T>,
field: &Cell<T>,
value: T,
) -> bool
pub fn set_and_raise_cell<T: PropertyValue + Copy>( &self, property: &'static DirectPropertyBase<T>, field: &Cell<T>, value: T, ) -> bool
set_and_raise for Copy values stored in a
Cell.
Sourcepub fn get_value_untyped(&self, property: &'static FerroProperty) -> BoxedValue
pub fn get_value_untyped(&self, property: &'static FerroProperty) -> BoxedValue
Gets a property value as an untyped value.
Sourcepub fn set_value_untyped(
&self,
property: &'static FerroProperty,
value: &dyn Any,
priority: BindingPriority,
) -> Option<Rc<dyn IDisposable>>
pub fn set_value_untyped( &self, property: &'static FerroProperty, value: &dyn Any, priority: BindingPriority, ) -> Option<Rc<dyn IDisposable>>
Sets a property from an untyped value, which must hold exactly the property’s value type or the unset marker.
Sourcepub fn set_current_value_untyped(
&self,
property: &'static FerroProperty,
value: &dyn Any,
)
pub fn set_current_value_untyped( &self, property: &'static FerroProperty, value: &dyn Any, )
set_current_value with an untyped value.
Sourcepub fn clear_value_untyped(&self, property: &'static FerroProperty)
pub fn clear_value_untyped(&self, property: &'static FerroProperty)
Clears a property’s local value.
Sourcepub fn bind_property_untyped(
&self,
property: &'static FerroProperty,
source: Rc<dyn IObservable<BoxedValue>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>
pub fn bind_property_untyped( &self, property: &'static FerroProperty, source: Rc<dyn IObservable<BoxedValue>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
Binds a property to an observable of untyped values.
Sourcepub fn property_changed(
&self,
handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) + 'static,
) -> Rc<dyn IDisposable>
pub fn property_changed( &self, handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) + 'static, ) -> Rc<dyn IDisposable>
Subscribes to property changes on this object. Disposing the returned handle unsubscribes.
Sourcepub fn add_property_changed_handler(
&self,
handler: Rc<dyn Fn(&FerroPropertyChangedEventArgs<'_>)>,
) -> u64
pub fn add_property_changed_handler( &self, handler: Rc<dyn Fn(&FerroPropertyChangedEventArgs<'_>)>, ) -> u64
Subscribes handler to property changes on this object and returns
the token that remove_property_changed_handler
takes: property_changed for a subscriber
that keeps the object and the token itself, so that no handle is made.
Sourcepub fn remove_property_changed_handler(&self, token: u64) -> bool
pub fn remove_property_changed_handler(&self, token: u64) -> bool
Ends a subscription of add_property_changed_handler.
Sourcepub fn property_changed_subscriber_count(&self) -> usize
pub fn property_changed_subscriber_count(&self) -> usize
The number of subscribers to property changes on this object (a diagnostics member, used by tests to verify that subscriptions are released).
Sourcepub fn raise_property_changed<T: PropertyValue>(
&self,
property: &'static FerroProperty,
old_value: Option<&T>,
new_value: &T,
priority: BindingPriority,
is_effective_value: bool,
)
pub fn raise_property_changed<T: PropertyValue>( &self, property: &'static FerroProperty, old_value: Option<&T>, new_value: &T, priority: BindingPriority, is_effective_value: bool, )
Raises a property changed notification.
Sourcepub fn raise_direct_property_changed<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
old_value: &T,
new_value: &T,
)
pub fn raise_direct_property_changed<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, old_value: &T, new_value: &T, )
Raises a property changed notification for a direct property.
Trait Implementations§
Source§impl Deref for EffectTransition
impl Deref for EffectTransition
Source§type Target = TransitionBase
type Target = TransitionBase
Source§fn deref(&self) -> &TransitionBase
fn deref(&self) -> &TransitionBase
Source§impl FerroObjectImpl for EffectTransition
impl FerroObjectImpl for EffectTransition
Source§fn constructed(this: &Self)
fn constructed(this: &Self)
parent_constructed first.Source§fn on_property_changed_core(
this: &Self,
change: &FerroPropertyChangedEventArgs<'_>,
)
fn on_property_changed_core( this: &Self, change: &FerroPropertyChangedEventArgs<'_>, )
on_property_changed instead.Source§fn on_property_changed(this: &Self, change: &FerroPropertyChangedEventArgs<'_>)
fn on_property_changed(this: &Self, change: &FerroPropertyChangedEventArgs<'_>)
Source§fn update_data_validation(
this: &Self,
property: &'static FerroProperty,
state: BindingValueType,
error: Option<&BindingError>,
)
fn update_data_validation( this: &Self, property: &'static FerroProperty, state: BindingValueType, error: Option<&BindingError>, )
Source§impl ObjectType for EffectTransition
impl ObjectType for EffectTransition
Source§type Parent = TransitionBase
type Parent = TransitionBase
Source§type VTable = <TransitionBase as ObjectType>::VTable
type VTable = <TransitionBase as ObjectType>::VTable
Source§fn vtable() -> &'static Self::VTable
fn vtable() -> &'static Self::VTable
Self.Source§fn register_class()
fn register_class()
Source§impl StaticType for EffectTransition
impl StaticType for EffectTransition
impl<T> Subclassable<T> for EffectTransitionwhere
TransitionBase: Subclassable<T>,
Source§impl Transition<Option<Rc<dyn IEffect>>> for EffectTransition
impl Transition<Option<Rc<dyn IEffect>>> for EffectTransition
Source§fn do_transition(
this: &Self,
progress: Rc<dyn IObservable<f64>>,
old_value: Option<Rc<dyn IEffect>>,
new_value: Option<Rc<dyn IEffect>>,
) -> Rc<dyn IObservable<Option<Rc<dyn IEffect>>>>
fn do_transition( this: &Self, progress: Rc<dyn IObservable<f64>>, old_value: Option<Rc<dyn IEffect>>, new_value: Option<Rc<dyn IEffect>>, ) -> Rc<dyn IObservable<Option<Rc<dyn IEffect>>>>
old_value to new_value, driven by progress (from 0 to 1).Source§impl TransitionBaseImpl for EffectTransition
impl TransitionBaseImpl for EffectTransition
Source§fn apply(
this: &Self,
control: &Animatable,
clock: Rc<dyn IClock>,
old_value: &BoxedValue,
new_value: &BoxedValue,
) -> Rc<dyn IDisposable>
fn apply( this: &Self, control: &Animatable, clock: Rc<dyn IClock>, old_value: &BoxedValue, new_value: &BoxedValue, ) -> Rc<dyn IDisposable>
control: animates the transition’s
property from old_value to new_value.Source§fn value_type(_this: &Self) -> (TypeId, &'static str)
fn value_type(_this: &Self) -> (TypeId, &'static str)
Source§impl Upcast<EffectTransition> for EffectTransition
impl Upcast<EffectTransition> for EffectTransition
fn upcast(&self) -> &EffectTransition
Auto Trait Implementations§
impl !Freeze for EffectTransition
impl !RefUnwindSafe for EffectTransition
impl !Send for EffectTransition
impl !Sync for EffectTransition
impl !UnwindSafe for EffectTransition
impl Unpin for EffectTransition
impl UnsafeUnpin for EffectTransition
Blanket Implementations§
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