Partager via


IXRControl::GoToVisualState (Windows Embedded CE 6.0)

1/6/2010

This method transitions the control between two states.

Syntax

virtual HRESULT STDMETHODCALLTYPE GoToVisualState(
    const WCHAR *pStateName,
    bool UseTransitions
) = 0;

Parameters

  • pStateName
    [in] Pointer to a string that indicates the state to transition to. For example:

    • Checked
    • Disabled
    • Focused
    • Indeterminate
    • MouseOver
    • Normal
    • Pressed
    • Unchecked
    • Unfocused
  • UseTransitions
    [in] Value that indicates whether to use visual transitions that are defined in the control to transition between states. This value is true if visual transitions will be used; otherwise it is false.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

This method performs the logic necessary to appropriately start and stop the storyboards that are associated with a transition. When a control calls GoToVisualState to changes its state, the Visual State Manager does one of the following:

  • If the IXRVisualState object for the state to which the control is transitioning has an IXRStoryboard object, that storyboard begins. Then, if the IXRVisualState object for the state from which the control has transitioned from has an IXRStoryboard object, that storyboard ends.
  • If the control is already in the state specified in pStateName, this method takes no action.
  • If the state specified in pStateName does not exist in the control template of this control, this method takes no action.

You can call this method from inside an event handler. For more information about visual states and visual transitions, see IXRVisualState and IXRVisualTransition.

.NET Framework Equivalent

System.Windows.VisualStateManager.GoToState

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

IXRControl