FrameworkElement.Tag Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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); };
[System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)]
public object Tag { get; set; }
[<System.Windows.Localizability(System.Windows.LocalizationCategory.NeverLocalize)>]
member this.Tag : obj with get, set
Public Property Tag As Object
Property Value
The intended value. This property has no default value.
- Attributes
Remarks
This property is analogous to Tag properties in other Microsoft programming models, such as Visual Basic for Applications or Windows Forms. Tag is intended to provide a pre-existing property location where you can store some basic custom information about any FrameworkElement without requiring you to subclass an element.
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 manner 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. For details, see XAML Namespaces and Namespace Mapping for WPF XAML and XAML and Custom Classes for WPF.
Dependency Property Information
Identifier field | TagProperty |
Metadata properties set to true |
None |
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기