Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

AttributeCallbackBuilder.AddCustomAttributes Method (String, Attribute[])

Adds attributes to the member with the specified name.

Namespace:  Microsoft.Windows.Design.Metadata
Assembly:  Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)

public void AddCustomAttributes(
	string memberName,
	params Attribute[] attributes


Type: System.String
The member to add attributes for. Only property and event members are supported; all others will be ignored.
Type: System.Attribute[]
An array of new attributes to add.


memberName or attributes is null.

The member can be a property or an event. The member is evaluated on demand when the user queries attributes on a given property or event.

The following code example shows how to add an attribute to a member by using the AttributeCallbackBuilder class. This code example is part of a larger example provided for the AttributeCallbackBuilder class.

// Apply the ReadOnlyAttribute to the Background property 
// of the Button class.
    new ReadOnlyAttribute(true));

Community Additions

© 2015 Microsoft