Compartilhar via


VisualStateManager.CustomVisualStateManager Attached Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the VisualStateManager that transitions between the states of a control.

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

Syntax

'Declaration
See GetCustomVisualStateManager, SetCustomVisualStateManager
See GetCustomVisualStateManager, SetCustomVisualStateManager
<templateRoot>
  <VisualStateManager.CustomVisualStateManager>
singleCustomVisualStateManager
  </VisualStateManager.CustomVisualSstateManager>
</templateRoot>
<templateRoot VisualStateManager.CustomVisualStateManager="{StaticResource customVisualStateManagerKey}"/>

XAML Values

  • templateRoot
    The root UIElement of content for a template applied to a control.

  • singleCustomVisualStateManager
    An object element for a class that implements a custom VisualStateManager.

  • customVisualStateManagerKey
    A resource key referring to an existing resource in a ResourceDictionary. The resource should be an object element instantiation of a custom VisualStateManager class.

Property Value

Type: System.Windows.VisualStateManager
The VisualStateManager that transitions between the states of a control. The default is nulla null reference (Nothing in Visual Basic).

Remarks

Use the CustomVisualStateManager property if you want to implement your own logic for transitioning between states. If CustomVisualStateManager is nulla null reference (Nothing in Visual Basic), the VisualStateManager uses its own logic to transition between states.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.