XamlDirect.ClearProperty(IXamlDirectObject, XamlPropertyIndex) 方法

定义

清除给定 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)

参数

xamlDirectObject
IXamlDirectObject

对特定 IXamlDirectObject 的引用。

propertyIndex
XamlPropertyIndex

对要从 XamlPropertyIndex 枚举中支持的属性列表中清除的属性的引用。

示例

以下示例演示如何通过 XamlDirect API 清除 Border 元素的 MinHeight 属性的值。

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);

适用于