Share via


SwapChainPanel.CompositionScaleChanged Event

Definition

Occurs when the composition scale factor of the SwapChainPanel has changed.

// Register
event_token CompositionScaleChanged(TypedEventHandler<SwapChainPanel, IInspectable const&> const& handler) const;

// Revoke with event_token
void CompositionScaleChanged(event_token const* cookie) const;

// Revoke with event_revoker
SwapChainPanel::CompositionScaleChanged_revoker CompositionScaleChanged(auto_revoke_t, TypedEventHandler<SwapChainPanel, IInspectable const&> const& handler) const;
public event TypedEventHandler<SwapChainPanel,object> CompositionScaleChanged;
function onCompositionScaleChanged(eventArgs) { /* Your code */ }
swapChainPanel.addEventListener("compositionscalechanged", onCompositionScaleChanged);
swapChainPanel.removeEventListener("compositionscalechanged", onCompositionScaleChanged);
- or -
swapChainPanel.oncompositionscalechanged = onCompositionScaleChanged;
Public Custom Event CompositionScaleChanged As TypedEventHandler(Of SwapChainPanel, Object) 
<SwapChainPanel CompositionScaleChanged="eventhandler"/>

Event Type

Remarks

The supplier of the swap chain content might need to resize their content if a layout pass determines a new size for the panel or containers it's within, or if a RenderTransform is applied on the SwapChainPanel or any of its ancestors. Changes of this nature aren't always originated by app logic that's easy to detect from other events (for example the user might change a device orientation or a view state that causes layout to rerun), so this event provides a notification specifically for the scenario of changing the swap chain content size, which would typically invert the scale factors applied.

Check CompositionScaleX and CompositionScaleY any time you are handling CompositionScaleChanged (CompositionScaleChanged doesn't have event data, but if it fires it means that one or both properties have changed values on this SwapChainPanel).

This event fires asynchronously versus the originating change. For example, dynamic animations or manipulations might affect the scale factor, and the event is raised when those dynamic changes are completed.

Applies to