ViewportBehavior Class

Definition

A class for listening element enter or exit the ScrollViewer viewport

public class ViewportBehavior : CommunityToolkit.WinUI.UI.Behaviors.BehaviorBase<Microsoft.UI.Xaml.FrameworkElement>
type ViewportBehavior = class
    inherit BehaviorBase<FrameworkElement>
Public Class ViewportBehavior
Inherits BehaviorBase(Of FrameworkElement)
Inheritance
Microsoft.Xaml.Interactivity.Behavior<T>
BehaviorBase<Microsoft.UI.Xaml.FrameworkElement>
ViewportBehavior

Constructors

ViewportBehavior()

Fields

IsAlwaysOnProperty

The IsAlwaysOn value of the associated element

IsFullyInViewportProperty

The IsFullyInViewport value of the associated element

IsInViewportProperty

The IsInViewport value of the associated element

Properties

IsAlwaysOn

Gets or sets a value indicating whether this behavior will remain attached after the associated element enters the viewport. When false, the behavior will remove itself after entering.

IsAttached

Gets a value indicating whether this behavior is attached.

(Inherited from BehaviorBase<T>)
IsFullyInViewport

Gets a value indicating whether associated element is fully in the ScrollViewer viewport

IsInViewport

Gets a value indicating whether associated element is in the ScrollViewer viewport

Methods

Initialize()

Initializes the behavior to the associated object.

(Inherited from BehaviorBase<T>)
OnAssociatedObjectLoaded()

Called when the associated object has been loaded.

(Inherited from BehaviorBase<T>)
OnAssociatedObjectUnloaded()

Called when the associated object has been unloaded.

(Inherited from BehaviorBase<T>)
OnAttached()

Called after the behavior is attached to the Microsoft.Xaml.Interactivity.Behavior.AssociatedObject.

OnDetaching()

Called when the behavior is being detached from its Microsoft.Xaml.Interactivity.Behavior.AssociatedObject.

Uninitialize()

Uninitializes the behavior from the associated object.

(Inherited from BehaviorBase<T>)

Events

EnteredViewport

Associated element fully enter the ScrollViewer viewport event

EnteringViewport

Associated element enter the ScrollViewer viewport event

ExitedViewport

Associated element fully exit the ScrollViewer viewport event

ExitingViewport

Associated element exit the ScrollViewer viewport event

Applies to