x:Uid Attribute

Provides an identifier within markup elements that is used by localization processes and tools.

XAML Attribute Usage

<object x:Uid="identifier"... />
-or-
<object>
  <object.property x:Uid="identifier"... >
    ...
</object.property>
</object>

XAML Values

identifier

A manually created or autogenerated string that is expected to be unique within the file, when interpreted by localization processes or tools.

Remarks

x:Uid is the singular exceptional case in Extensible Application Markup Language (XAML) where an attribute is permitted to be on a property element. All other attributes are invalid on a property element.  This usage is necessary because a property element can still contain a string, and the only way to mark that string to be a unique resource that needs to be localized is to place the x:Uid attribute on the enclosing property element.

Custom Extensible Application Markup Language (XAML) processors must not raise an error condition if they encounter x:Uid on a property element.

Extensible Application Markup Language (XAML) processors in the generic sense (processors that are not necessarily part of the localization process) are not expected to enforce uniqueness of x:Uid values. That responsibility is on the originator of the values, and the expectation of uniqueness is reasonable for consumers of the values, such as dedicated globalization processes or tools.

See Also

Concepts

Globalization for the Windows Presentation Foundation

Reference

Uid

UidManager