TemplateVisualStateAttribute.GroupName Property

Definition

Gets or sets the name of the group that the state belongs to.

public string GroupName { get; set; }

Property Value

The name of the VisualStateGroup that the state belongs to.

Examples

The following example shows the class signature for the NumericUpDown control. This example specifies that the NumericUpDown control uses four visual states. Two states, named Positive and Negative, are in the VisualStateGroup named ValueStates. The other two states, name Focused and Unfocused, are in the VisualStateGroup named FocusedStates. For the entire example, see Creating a Control That Has a Customizable Appearance.

[TemplatePart(Name = "UpButtonElement", Type = typeof(RepeatButton))]
[TemplatePart(Name = "DownButtonElement", Type = typeof(RepeatButton))]
[TemplateVisualState(Name = "Positive", GroupName = "ValueStates")]
[TemplateVisualState(Name = "Negative", GroupName = "ValueStates")]
[TemplateVisualState(Name = "Focused", GroupName = "FocusedStates")]
[TemplateVisualState(Name = "Unfocused", GroupName = "FocusedStates")]
public class NumericUpDown : Control

Remarks

The GroupName property corresponds to the VisualStateGroup.Name property of a VisualStateGroup object. To specify what VisualStateGroup a VisualState belongs in, set the GroupName property.

Applies to

Prodotto Versioni
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9