Redigeeri

Jagamisviis:


FrameworkContentElement.Tag Property

Definition

Gets or sets an arbitrary object value that can be used to store custom information about this element.

public:
 property System::Object ^ Tag { System::Object ^ get(); void set(System::Object ^ value); };
public object Tag { get; set; }
member this.Tag : obj with get, set
Public Property Tag As Object

Property Value

The intended value. This property has no default value.

Remarks

This property is analogous to Tag properties in other Microsoft programming models, such as Visual Basic for Applications or Windows Forms. It is intended to provide a pre-existing place to store some basic custom information about any element without forcing application developers to subclass.

XAML Values

Because this property takes an object, you need to use the property element usage in order to set the Tag property in XAML to anything other than an object with a known and built-in type converter, such as a string. Objects used in this way are typically not within the standard WPF namespaces and therefore may require namespace mapping to the external namespace in order to be introduced as XAML elements.

Dependency Property Information

Identifier field TagProperty
Metadata properties set to true None

Applies to

See also