TemplateVisualStateAttribute.Name Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the name of the state that the control can be in.
public:
property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public string Name { get; set; }
member this.Name : string with get, set
Public Property Name As String
The name of the state that the control can be in.
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
<TemplatePart(Name:="UpButtonElement", Type:=GetType(RepeatButton))> _
<TemplatePart(Name:="DownButtonElement", Type:=GetType(RepeatButton))> _
<TemplateVisualState(Name:="Positive", GroupName:="ValueStates")> _
<TemplateVisualState(Name:="Negative", GroupName:="ValueStates")> _
<TemplateVisualState(Name:="Focused", GroupName:="FocusedStates")> _
<TemplateVisualState(Name:="Unfocused", GroupName:="FocusedStates")> _
Public Class NumericUpDown
Inherits Control
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.
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 |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: