Symphony Framework
NavigateStateCommand Constructor
Example 
Symphony.Conductor.Commands Namespace > NavigateStateCommand Class : NavigateStateCommand Constructor
Inject the View Model.
Creates and instance of the NavigateStateCommand to allow control of navigation of a user interface controls visual states.
Syntax
public NavigateStateCommand( 
   BaseViewModel viewModel
)

Parameters

viewModel
Inject the View Model.
Remarks
By supplying an instance of a class derived from the Symphony.Conductor.ViewModel.BaseViewModel the NavigateStateCommand can utilise the visual state stack defined within the Symphony.Conductor.ViewModel.BaseViewModel derived class to navigate to the required visual state. The name of the state should be defined in the view using the CommandParameter attribute. Within the Symphony.Conductor.ViewModel.BaseViewModel class there is already a property() that is an instnace of the NavigateStateCommand and therefore you can use that property to data-bind to the User Interface controls.
Example
private NavigateStateCommand mNavigateVisualState;

public NavigateStateCommand NavigateVisualState
{
    get
    {
        return mNavigateVisualState == null ? mNavigateVisualState = new NavigateStateCommand(this) : mNavigateVisualState;
    }
}
private QuitStateCommand mQuitVisualState;

public QuitStateCommand QuitVisualState
{
    get
    {
        return mQuitVisualState == null ? mQuitVisualState = new QuitStateCommand(this) : mQuitVisualState;
    }
}
<VisualStateManager.VisualStateGroups>
    <VisualStateGroup x:Name="applicationStates">

        <VisualState x:Name="BaseViewState">
            <Storyboard>
                <DoubleAnimation Storyboard.TargetName="messageView" Storyboard.TargetProperty="(Opacity)" Duration="0:0:0" To="0" />
                <BooleanAnimationUsingKeyFrames Storyboard.TargetName="messageView" Storyboard.TargetProperty="(IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="0:0:0" Value="False"></DiscreteBooleanKeyFrame>
                </BooleanAnimationUsingKeyFrames>
                <Int32Animation Storyboard.TargetName="messageView" Storyboard.TargetProperty="(Panel.ZIndex)" To="0" />

                <DoubleAnimation Storyboard.TargetName="baseView" Storyboard.TargetProperty="(Opacity)" Duration="0:0:0" To="1" />
                <BooleanAnimationUsingKeyFrames Storyboard.TargetName="baseView" Storyboard.TargetProperty="(IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="0:0:0" Value="True"></DiscreteBooleanKeyFrame>
                </BooleanAnimationUsingKeyFrames>
                <Int32Animation Storyboard.TargetName="baseView" Storyboard.TargetProperty="(Panel.ZIndex)" To="1" />


            </Storyboard>
        </VisualState>

        <VisualState x:Name="MessageViewState">
            <Storyboard>

                <DoubleAnimation Storyboard.TargetName="baseView" Storyboard.TargetProperty="(Opacity)" Duration="0:0:0" To="0" />
                <BooleanAnimationUsingKeyFrames Storyboard.TargetName="baseView" Storyboard.TargetProperty="(IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="0:0:0" Value="False"></DiscreteBooleanKeyFrame>
                </BooleanAnimationUsingKeyFrames>
                <Int32Animation Storyboard.TargetName="baseView" Storyboard.TargetProperty="(Panel.ZIndex)" To="0" />

                <DoubleAnimation Storyboard.TargetName="messageView" Storyboard.TargetProperty="(Opacity)" Duration="0:0:0" To="1" />
                <BooleanAnimationUsingKeyFrames Storyboard.TargetName="messageView" Storyboard.TargetProperty="(IsEnabled)">
                    <DiscreteBooleanKeyFrame KeyTime="0:0:0" Value="True"></DiscreteBooleanKeyFrame>
                </BooleanAnimationUsingKeyFrames>
                <Int32Animation Storyboard.TargetName="messageView" Storyboard.TargetProperty="(Panel.ZIndex)" To="1" />

            </Storyboard>
        </VisualState>
    </VisualStateGroup>
</VisualStateManager.VisualStateGroups>
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

NavigateStateCommand Class
NavigateStateCommand Members