Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FrameworkElement.Tag Property

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

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

public Object Tag { get; set; }
<frameworkElement>
  <frameworkElement.Tag>
    object*
  </frameworkElement.Tag>
</frameworkElement>
<frameworkElement Tag="string"/>

XAML Values

object*

A Silverlight object or a custom object that supports object element syntax (the backing type must be nonabstract and must support a public default constructor).

string

A string value (can be a true string, or input for an object type that supports type conversion from string).

Property Value

Type: System.Object
The intended value. This property has no default value.

Dependency property identifier field: TagProperty

This property is similar to Tag properties in other programming models. Tag is intended to provide a preexisting property location where you can store some basic custom information about any FrameworkElement without requiring you to derive from FrameworkElement or an intermediate class.

Because this property takes an object, a property element usage is required to set the Tag property in XAML to anything other than an object with a type converter, such as a string. Objects used in this manner are typically not within the standard Silverlight XAML namespaces and therefore may require mapping an external namespace in order to be introduced as XAML object elements.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft