Share via


ElementCompositionPreview Class

Definition

Enables access to composition visual objects that back XAML elements in the XAML composition tree.

public ref class ElementCompositionPreview sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ElementCompositionPreview final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ElementCompositionPreview
Public NotInheritable Class ElementCompositionPreview
Inheritance
Object Platform::Object IInspectable ElementCompositionPreview
Attributes

Examples

This sample shows how to add a WASDK island with XAML content to a Win32 app (the Windows App SDK runtime must be installed for the app to run).

Simple Island App

Remarks

ElementCompositionPreview allows access to the Windows.UI.Composition.Visual object backing a XAML element with the GetElementVisual method. Once the backing object has been retrieved it can be manipulated using the Windows.UI.Composition namespace. This allows properties of the object to be changed, like the orientation, or additional objects to be added to the XAML composition tree.

Methods

GetElementChildVisual(UIElement)

Retrieves a Windows.UI.Composition.Visual object previously set by a call to SetElementChildVisual.

GetElementVisual(UIElement)

Retrieves the Windows.UI.Composition.Visual object that backs a XAML element in the XAML composition tree.

GetPointerPositionPropertySet(UIElement)

Retrieves the pointer position relative to a UIElement.

GetScrollViewerManipulationPropertySet(ScrollViewer)

Retrieves the composition properties of a ScrollViewer element.

SetElementChildVisual(UIElement, Visual)

Sets a custom Windows.UI.Composition.Visual as the last child of the element’s visual tree.

SetImplicitHideAnimation(UIElement, ICompositionAnimationBase)

Associates the specified hide animation with a UIElement.

SetImplicitShowAnimation(UIElement, ICompositionAnimationBase)

Associates the specified show animation with a UIElement.

SetIsTranslationEnabled(UIElement, Boolean)

Toggles the ability to set, animate, and use a render-time post-layout translate transform to position XAML elements on screen using Composition APIs.

Applies to

See also