<Page
    x:Class="VisualState.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:VisualState"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="500"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="300"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <TextBlock Name="title" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="50,50,0,0" 
                   Text="VisualState-Demo-App" FontSize="50" Grid.ColumnSpan="2" />

        <StackPanel Grid.Column="1" Grid.Row="1" 
                    HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                    Orientation="Horizontal">

            <Image Name="dogImage" Source="Assets/Dogh07.png"  Tapped="Image_Tapped_1"    />
            <TextBlock Name="dogText" FontSize="40" VerticalAlignment="Bottom"/>
        </StackPanel>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup >
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="title" 
                                                       Storyboard.TargetProperty="Text">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="VisualState"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="dogText" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="NotSnapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="title" 
                                                       Storyboard.TargetProperty="Text">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="VisualState-Demo-App"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="dogText" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>


    </Grid>
</Page>
