Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.91 KB

visualstategroup_name.md

File metadata and controls

39 lines (25 loc) · 1.91 KB
-api-id -api-type
P:Windows.UI.Xaml.VisualStateGroup.Name
winrt property

Windows.UI.Xaml.VisualStateGroup.Name

-description

Gets the name of the VisualStateGroup.

-xaml-syntax

<VisualStateGroup x:Name="groupName"/>

-xaml-values

groupName
groupNameThe name of the VisualStateGroup. Name is a read-only property, so specify the name of the VisualStateGroup by setting the x:Name attribute. An unprefixed string Name won't work.
## -property-value The name of the [VisualStateGroup](visualstategroup.md).

-remarks

Name is a read-only property that you can check with code at run-time to read the value of the x:Name attribute that was applied to a VisualStateGroup in a XAML control template. You can't literally set Name because it's read-only, and x:Name attribute can only be set in XAML. The value is available as soon as the XAML that contains the control template and the VisualStateGroup definition is loaded.

The need to check the Name of a VisualStateGroup at run-time is anticipated to be relatively uncommon, and would only be relevant to advanced scenarios. For the most part, the definition of a VisualStateGroup in XAML combined with using VisualStateManager and VisualStateGroup events in code provides you all that you need to define and invoke visual states for a custom or Windows Runtime-defined control.

-examples

-see-also

Quickstart: Control templates, x:Name attribute, VisualStateManager