Share via


ElementRealizationOptions Enum

Definition

Defines constants that specify whether to suppress automatic recycling of the retrieved element or force creation of a new element.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

This enumeration supports a bitwise combination of its member values.

public enum class ElementRealizationOptions
/// [Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=0)]
/// [System.Flags]
/// [Windows.Foundation.Metadata.Version(1)]
enum class ElementRealizationOptions
/// [System.Flags]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.XamlContract, 65536)]
enum class ElementRealizationOptions
[Microsoft.UI.Xaml.CustomAttributes.MUXContractProperty(version=0)]
[System.Flags]
[Windows.Foundation.Metadata.Version(1)]
public enum ElementRealizationOptions
[System.Flags]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.XamlContract), 65536)]
public enum ElementRealizationOptions
Public Enum ElementRealizationOptions
Inheritance
ElementRealizationOptions
Attributes
Microsoft.UI.Xaml.CustomAttributes.MUXContractPropertyAttribute FlagsAttribute VersionAttribute ContractVersionAttribute

Fields

Name Value Description
None 0

No option is specified.

ForceCreate 1

Creation of a new element is forced.

SuppressAutoRecycle 2

The element is ignored by the automatic recycling logic.

Remarks

When you call GetOrCreateElementAt(index, options), you can specify whether to suppress automatic recycling of the retrieved element or force creation of a new element. Elements retrieved with automatic recycling suppressed (SuppressAutoRecycle) are ignored by the automatic recycling logic that clears realized elements that were not retrieved as part of the current layout pass. You must explicitly recycle these elements by passing them to the RecycleElement method to avoid memory leaks.

Applies to

See also