XamlDirect Class

Definition

Represents the base class for all XamlDirect APIs. All of the XamlDirect APIs are instance methods of this class.

XamlDirect is an API for accessing Xaml at a more primitive level for better CPU and working set performance.

public ref class XamlDirect sealed
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Microsoft.UI.Xaml.Core.Direct.__IXamlDirectStatics, 1)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Version(1)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class XamlDirect final
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.Core.Direct.XamlDirectContract, 65536)]
/// [Windows.Foundation.Metadata.Static(Microsoft.UI.Xaml.Core.Direct.IXamlDirectStatics, 65536, "Microsoft.UI.Xaml.Core.Direct.XamlDirectContract")]
class XamlDirect final
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Microsoft.UI.Xaml.Core.Direct.__IXamlDirectStatics), 1)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Version(1)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class XamlDirect
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.Core.Direct.XamlDirectContract), 65536)]
[Windows.Foundation.Metadata.Static(typeof(Microsoft.UI.Xaml.Core.Direct.IXamlDirectStatics), 65536, "Microsoft.UI.Xaml.Core.Direct.XamlDirectContract")]
public sealed class XamlDirect
Public NotInheritable Class XamlDirect
Inheritance
XamlDirect
Attributes
Windows.Foundation.Metadata.MarshalingBehaviorAttribute Windows.Foundation.Metadata.StaticAttribute Windows.Foundation.Metadata.ThreadingAttribute Windows.Foundation.Metadata.VersionAttribute Windows.Foundation.Metadata.WebHostHiddenAttribute Windows.Foundation.Metadata.ContractVersionAttribute

Examples

See the XAML Controls Gallery sample app for examples of WinUI features and controls.

If you have the XAML Controls Gallery app installed, open the app to see the controls in action.

If you don't have the XAML Controls Gallery app installed, get the WinUI 2.x version from the Microsoft Store.

You can also view, clone, and build the XAML Controls Gallery source code from GitHub (switch to the WinUI 3 Preview branch for WinUI 3 Preview controls and features).

Methods

AddEventHandler(IXamlDirectObject, XamlEventIndex, Object)

Adds the specified event handler for a specified event using XamlEventIndex, adding the handler to the handler collection on the current IXamlDirectObject.

AddEventHandler(IXamlDirectObject, XamlEventIndex, Object, Boolean)

Adds the specified event handler for a specified event using XamlEventIndex, adding the handler to the handler collection on the current IXamlDirectObject. Specify handledEventsToo as true to have the provided handler be invoked even if the event is handled elsewhere.

AddToCollection(IXamlDirectObject, IXamlDirectObject)

Adds a value to the specified IXamlDirectObject collection.

ClearCollection(IXamlDirectObject)

Removes all items from the specified IXamlDirectObject collection.

ClearProperty(IXamlDirectObject, XamlPropertyIndex)

Clears the value of the specified property on a given IXamlDirectObject.

CreateInstance(XamlTypeIndex)

Creates an IXamlDirectObject instance of the type specified by the XamlTypeIndex parameter.

GetBooleanProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Boolean property for a specific IXamlDirectObject.

GetCollectionCount(IXamlDirectObject)

Returns the count of items in the specified IXamlDirectObject collection.

GetColorProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Color property for a specific IXamlDirectObject.

GetCompat()

Gets the

GetCornerRadiusProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a CornerRadius property for a specific IXamlDirectObject.

GetDateTimeProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a DateTimeOffset property for a specific IXamlDirectObject.

GetDefault()

Returns the current XamlDirect instance.

GetDoubleProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Double property for a specific IXamlDirectObject.

GetDurationProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Duration property for a specific IXamlDirectObject.

GetEnumProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of an Enum property for a specific IXamlDirectObject.

GetGridLengthProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a GridLength property for a specific IXamlDirectObject.

GetInt32Property(IXamlDirectObject, XamlPropertyIndex)

Gets the value of an Int32 property for a specific IXamlDirectObject.

GetMatrix3DProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Matrix3D property for a specific IXamlDirectObject.

GetMatrixProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Matrix property for a specific IXamlDirectObject.

GetObject(IXamlDirectObject)

Gets (and creates if necessary) the instance as its full XAML type of the specified IXamlDirectObject.

GetObjectProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of an object property for a specific IXamlDirectObject.

GetPointProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Point property for a specific IXamlDirectObject.

GetRectProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Rect property for a specific IXamlDirectObject.

GetSizeProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Size property for a specific IXamlDirectObject.

GetStringProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a string property for a specific IXamlDirectObject.

GetThicknessProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a Thickness property for a specific IXamlDirectObject.

GetTimeSpanProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of a TimeSpan property for a specific IXamlDirectObject.

GetWrapper()
GetXamlDirectObject(Object)

Gets the instance as an IXamlDirectObject for a given XAML type.

GetXamlDirectObjectFromCollectionAt(IXamlDirectObject, UInt32)

Returns the IXamlDirectObject item at the specified index from the specified IXamlDirectObject collection.

GetXamlDirectObjectProperty(IXamlDirectObject, XamlPropertyIndex)

Gets the value of an IXamlDirectObject property for a specific IXamlDirectObject.

InsertIntoCollectionAt(IXamlDirectObject, UInt32, IXamlDirectObject)

Inserts a value into the specified IXamlDirectObject collection at the specified index.

RemoveEventHandler(IXamlDirectObject, XamlEventIndex, Object)

Removes the specified event handler from this IXamlDirectObject. Typically, the handler in question was added by XamlDirect.AddEventHandler.

RemoveFromCollection(IXamlDirectObject, IXamlDirectObject)

Tries to remove a value from the specified IXamlDirectObject collection.

RemoveFromCollectionAt(IXamlDirectObject, UInt32)

Tries to remove a value from the IXamlDirectObject collection at the specified index.

SetBooleanProperty(IXamlDirectObject, XamlPropertyIndex, Boolean)

Sets the value of a Boolean property for a specific IXamlDirectObject.

SetColorProperty(IXamlDirectObject, XamlPropertyIndex, Color)

Sets the value of a Color property for a specific IXamlDirectObject.

SetCornerRadiusProperty(IXamlDirectObject, XamlPropertyIndex, CornerRadius)

Sets the value of a CornerRadius property for a specific IXamlDirectObject.

SetDateTimeProperty(IXamlDirectObject, XamlPropertyIndex, DateTimeOffset)

Sets the value of a DateTimeOffset property for a specific IXamlDirectObject.

SetDoubleProperty(IXamlDirectObject, XamlPropertyIndex, Double)

Sets the value of a Double property for a specific IXamlDirectObject.

SetDurationProperty(IXamlDirectObject, XamlPropertyIndex, Duration)

Sets the value of a Duration property for a specific IXamlDirectObject.

SetEnumProperty(IXamlDirectObject, XamlPropertyIndex, UInt32)

Sets the value of an Enum property for a specific IXamlDirectObject.

SetGridLengthProperty(IXamlDirectObject, XamlPropertyIndex, GridLength)

Sets the value of a GridLength property for a specific IXamlDirectObject.

SetInt32Property(IXamlDirectObject, XamlPropertyIndex, Int32)

Sets the value of an Int32 property for a specific IXamlDirectObject.

SetMatrix3DProperty(IXamlDirectObject, XamlPropertyIndex, Matrix3D)

Sets the value of a Matrix3D property for a specific IXamlDirectObject.

SetMatrixProperty(IXamlDirectObject, XamlPropertyIndex, Matrix)

Sets the value of a Matrix property for a specific IXamlDirectObject.

SetObjectProperty(IXamlDirectObject, XamlPropertyIndex, Object)

Sets the value of an object property for a specific IXamlDirectObject.

SetPointProperty(IXamlDirectObject, XamlPropertyIndex, Point)

Sets the value of a Point property for a specific IXamlDirectObject.

SetRectProperty(IXamlDirectObject, XamlPropertyIndex, Rect)

Sets the value of a Rect property for a specific IXamlDirectObject.

SetSizeProperty(IXamlDirectObject, XamlPropertyIndex, Size)

Sets the value of a Size property for a specific IXamlDirectObject.

SetStringProperty(IXamlDirectObject, XamlPropertyIndex, String)

Sets the value of a string property for a specific IXamlDirectObject.

SetThicknessProperty(IXamlDirectObject, XamlPropertyIndex, Thickness)

Sets the value of a Thickness property for a specific IXamlDirectObject.

SetTimeSpanProperty(IXamlDirectObject, XamlPropertyIndex, TimeSpan)

Sets the value of a TimeSpan property for a specific IXamlDirectObject.

SetXamlDirectObjectProperty(IXamlDirectObject, XamlPropertyIndex, IXamlDirectObject)

Sets the value of an IXamlDirectObject property for a specific IXamlDirectObject.

Applies to

See also