TemplateVisualStateAttribute.GroupName Property

 

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

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

public string GroupName { get; set; }

Property Value

Type: System.String

The name of the VisualStateGroup that the state belongs to.

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.

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

.NET Framework
Available since 4.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: