Share via


ElementCompositionPreview 類別

定義

可讓您存取 XAML 組合樹狀結構中支援 XAML 元素的組合視覺物件。

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
繼承
Object Platform::Object IInspectable ElementCompositionPreview
屬性

備註

ElementCompositionPreview 允許使用GetElementVisual方法存取支援 XAML 元素的Windows.UI.Composition.Visual物件。 一旦擷取備份物件,就可以使用 Windows.UI.Composition 命名空間來操作。 這可讓物件的屬性變更,例如方向,或要新增至 XAML 組合樹狀結構的其他物件。

方法

GetElementChildVisual(UIElement)

擷取先前由SetElementChildVisual呼叫所設定的Windows.UI.Composition.Visual物件。

GetElementVisual(UIElement)

擷取 Windows.UI.Composition.Visual 物件,該物件會備份 XAML 組合樹狀結構中的 XAML 專案。

GetPointerPositionPropertySet(UIElement)

擷取相對於 UIElement 的指標位置。

GetScrollViewerManipulationPropertySet(ScrollViewer)

擷取 ScrollViewer 專案的組合屬性。

SetElementChildVisual(UIElement, Visual)

將自訂 Windows.UI.Composition.Visual 設定為專案視覺化樹狀結構的最後一個子系。

SetImplicitHideAnimation(UIElement, ICompositionAnimationBase)

將指定的隱藏動畫與 UIElement 產生關聯。

SetImplicitShowAnimation(UIElement, ICompositionAnimationBase)

將指定的顯示動畫與 UIElement 產生關聯。

SetIsTranslationEnabled(UIElement, Boolean)

切換設定、動畫及使用轉譯時間後版面配置轉譯轉換的能力,以使用組合 API 將 XAML 元素放置在螢幕上。

適用於