Name Property
Collapse the table of content
Expand the table of content

TemplateVisualStateAttribute.Name Property

 

Gets or sets the name of the state that the control can be in.

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

public string Name { get; set; }

Property Value

Type: System.String

The name of the state that the control can be in.

The TemplateVisualStateAttribute.Name property corresponds to the VisualState.Name property of a VisualState. To specify what VisualState belongs in a control's ControlTemplate, set the TemplateVisualStateAttribute.Name 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:
© 2016 Microsoft