Share via


IXamlDirect.ClearProperty(Object, XamlPropertyIndex) Method

Definition

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

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

public:
 void ClearProperty(Platform::Object ^ xamlDirectObject, XamlPropertyIndex propertyIndex);
void ClearProperty(IInspectable const& xamlDirectObject, XamlPropertyIndex const& propertyIndex);
public void ClearProperty(object xamlDirectObject, XamlPropertyIndex propertyIndex);
Public Sub ClearProperty (xamlDirectObject As Object, propertyIndex As XamlPropertyIndex)

Parameters

xamlDirectObject
Object

Platform::Object

IInspectable

A reference to the specific IXamlDirect.

propertyIndex
XamlPropertyIndex

A reference to the property to be cleared from the list of supported properties in XamlPropertyIndex enum.

Examples

The following example shows how to clear the value of a Border element's MinHeight property through XamlDirect APIs.

XamlDirect xd = XamlDirect.GetDefault();
IXamlDirect border = xd.CreateInstance(XamlTypeIndex.Border);
xd.ClearProperty(border, XamlPropertyIndex.FrameworkElement_MinHeight);
XamlDirect^ xd = XamlDirect::GetDefault();
IXamlDirect^ border = xd->CreateInstance(XamlTypeIndex::Border);
xd->ClearProperty(border, XamlPropertyIndex::FrameworkElement_MinHeight);

Applies to