ParallaxBehavior
struct · ferroui-xaml-interactions-custom · v0.5.0
struct ParallaxBehavior
A behavior that moves the associated element at a different speed than the scrolling container, creating a parallax effect.
Deviation (DEVIATIONS.md, Behaviors): the reference implements IObserver<Vector> and
subscribes itself to the offset of the scroll viewer; here the subscription is a closure that
calls on_next, and on_error and
on_completed are plain members (the class does not implement the
observer contract, an object of the class model is not shared as an Rc).
Members
TYPEto_refsource_scroll_viewer_propertyparallax_ratio_propertyconstructnewsource_scroll_viewerset_source_scroll_viewerparallax_ratioset_parallax_ratioon_completedon_erroron_next
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ParallaxBehavior>
Returns a strong reference to this object.
source_scroll_viewer_property
fn source_scroll_viewer_property() -> &'static StyledProperty<Option<ElementRef<ScrollViewer>>>
Identifies the SourceScrollViewer property.
Deviation (DEVIATIONS.md, Behaviors): the behavior does not own the scroll viewer, so the value is an element reference.
parallax_ratio_property
fn parallax_ratio_property() -> &'static StyledProperty<f64>
Identifies the ParallaxRatio property.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a behavior.
source_scroll_viewer
fn source_scroll_viewer(self: &Self) -> Option<Ref<ScrollViewer>>
Gets or sets the source scroll viewer. If not set, the behavior will attempt to find a parent scroll viewer. Markup resolves a name given for it to the named element.
set_source_scroll_viewer
fn set_source_scroll_viewer(self: &Self, value: impl Into<Nullable<ScrollViewer>>)
parallax_ratio
fn parallax_ratio(self: &Self) -> f64
Gets or sets the parallax ratio. 0.0 means no movement (static). 1.0 means moves with scroll (normal). Values between 0 and 1 create a "far away" depth effect. Negative values move in reverse.
set_parallax_ratio
fn set_parallax_ratio(self: &Self, value: f64)
on_completed
fn on_completed(self: &Self)
Notifies the behavior that the offset observable completed (IObserver.OnCompleted).
on_error
fn on_error(self: &Self, _error: ObservableError)
Notifies the behavior that the offset observable failed (IObserver.OnError).
on_next
fn on_next(self: &Self, value: Vector)
Applies the parallax offset for the scroll offset value (IObserver.OnNext).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherBehaviorImplExtDerefUpcast<T>Upcast<ParallaxBehavior>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImplBehaviorImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.