Share via


XamlDirect.ClearProperty(IXamlDirectObject, XamlPropertyIndex) Method

Definition

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

public:
 virtual void ClearProperty(IXamlDirectObject ^ xamlDirectObject, XamlPropertyIndex propertyIndex) = ClearProperty;
void ClearProperty(IXamlDirectObject const& xamlDirectObject, XamlPropertyIndex const& propertyIndex);
public void ClearProperty(IXamlDirectObject xamlDirectObject, XamlPropertyIndex propertyIndex);
function clearProperty(xamlDirectObject, propertyIndex)
Public Sub ClearProperty (xamlDirectObject As IXamlDirectObject, propertyIndex As XamlPropertyIndex)

Parameters

xamlDirectObject
IXamlDirectObject

A reference to the specific IXamlDirectObject.

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();
IXamlDirectObject border = xd.CreateInstance(XamlTypeIndex.Border);
xd.ClearProperty(border, XamlPropertyIndex.FrameworkElement_MinHeight);
XamlDirect^ xd = XamlDirect::GetDefault();
IXamlDirectObject^ border = xd->CreateInstance(XamlTypeIndex::Border);
xd->ClearProperty(border, XamlPropertyIndex::FrameworkElement_MinHeight);

Applies to