SwapChainPanel.CompositionScaleChanged Event
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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"/>
TypedEventHandler<SwapChainPanel,IInspectable>
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.
Product | Versies |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |