ElementCompositionPreview 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
允许访问 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
- 继承
- 属性
注解
ElementCompositionPreview 允许访问 Microsoft。Ui。Composition.Visual 使用 GetElementVisual 方法支持 XAML 元素的对象。 检索支持对象后,可以使用 Microsoft 对其进行操作。UI。Composition 命名空间。 这允许更改对象的属性,如方向,或要添加到 XAML 合成树的其他对象。
方法
| 名称 | 说明 |
|---|---|
| GetElementChildVisual(UIElement) |
检索以前通过调用 SetElementChildVisual 设置的 Composition.Visual 对象。 |
| GetElementVisual(UIElement) |
检索 Microsoft。Ui。Composition.Visual 对象,该对象在 XAML 合成树中备份 XAML 元素。 |
| GetPointerPositionPropertySet(UIElement) |
检索相对于 UIElement 的指针位置。 |
| GetScrollViewerManipulationPropertySet(ScrollViewer) |
检索 ScrollViewer 元素的合成属性。 |
| SetElementChildVisual(UIElement, Visual) |
将自定义 Composition.Visual 设置为元素可视化树的最后一个子级。 |
| SetImplicitHideAnimation(UIElement, ICompositionAnimationBase) |
将指定的隐藏动画与 UIElement 相关联。 |
| SetImplicitShowAnimation(UIElement, ICompositionAnimationBase) |
将指定的显示动画与 UIElement 相关联。 |
| SetIsTranslationEnabled(UIElement, Boolean) |
切换设置、创建动画和使用呈现时后布局转换转换的功能,以使用合成 API 在屏幕上放置 XAML 元素。 |