Udostępnij za pośrednictwem


ScrollingScrollAnimationStartingEventArgs.CorrelationId Property

Definition

Gets the correlation ID associated with the animated scroll offset change, previously returned by ScrollTo or ScrollBy.

public:
 property int CorrelationId { int get(); };
int CorrelationId();
public int CorrelationId { get; }
var int32 = scrollingScrollAnimationStartingEventArgs.correlationId;
Public ReadOnly Property CorrelationId As Integer

Property Value

Int32

int

The correlation ID associated with the animated scroll offset change.

Remarks

Each programmatic scroll or zoom change is associated with a particular correlation ID number. That number is provided when requesting a view change with ScrollTo, ScrollBy, AddScrollVelocity, ZoomTo, ZoomBy or AddZoomVelocity as a return value. A correlation ID is also provided in the BringingIntoView event raised at the beginning of a bring-into-view request participation. This marks the beginning of a correlation ID's lifetime.

That same number is then exposed in subsequent events like ScrollAnimationStarting and ScrollCompleted, or ZoomAnimationStarting and ZoomCompleted. This lets you match events with their triggering method call or request.

The lifetime of a correlation ID always ends in a completion event: ScrollCompleted or ZoomCompleted.

The lifetimes of correlation IDs can overlap. For example, two back-to-back ZoomTo calls will generate two correlation IDs with overlapping lifetimes.

When a new view change is requested while an old one is still in progress, the old one is cancelled. That cancellation triggers a ScrollCompleted or ZoomCompleted event with the old CorrelationId.

Applies to