<Page
    x:Class="ThreeDeeSpinningText.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ThreeDeeSpinningText"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    
    <Page.Resources>
        <Storyboard x:Key="xAxisAnimation" RepeatBehavior="Forever">
            <DoubleAnimation Storyboard.TargetName="projection"
                             Storyboard.TargetProperty="RotationX"
                             From="0" To="360" Duration="0:0:1.9" />
        </Storyboard>      
        
        <Storyboard x:Key="yAxisAnimation" RepeatBehavior="Forever">
            <DoubleAnimation Storyboard.TargetName="projection"
                             Storyboard.TargetProperty="RotationY"
                             From="0" To="360" Duration="0:0:3.1" />
        </Storyboard>    
        
        <Storyboard x:Key="zAxisAnimation" RepeatBehavior="Forever">
            <DoubleAnimation Storyboard.TargetName="projection"
                             Storyboard.TargetProperty="RotationZ"
                             From="0" To="360" Duration="0:0:4.3" />
        </Storyboard>
    </Page.Resources>

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <TextBlock Text="Tekst 3D"
                   FontSize="384"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center">
            <TextBlock.Projection>
                <PlaneProjection x:Name="projection" />
            </TextBlock.Projection>
        </TextBlock>
        
        <!-- Control Panel -->
        <Grid Grid.Row="1" HorizontalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            
            <Grid.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="FontSize" 
                            Value="{StaticResource ControlContentThemeFontSize}" />
                    <Setter Property="VerticalAlignment" Value="Center" />
                </Style>
                
                <Style TargetType="Button">
                    <Setter Property="Width" Value="120" />
                    <Setter Property="Margin" Value="12" />
                </Style>
            </Grid.Resources>
            
            <TextBlock Text="Oś X: " Grid.Row="0" Grid.Column="0"
                       Tag="xAxisAnimation" />
            <Button Content="Start" Grid.Row="0" Grid.Column="1"
                    Click="OnBeginStopButton" />
            <Button Content="Pauza" Grid.Row="0" Grid.Column="2"
                    IsEnabled="False"
                    Click="OnPauseResumeButton" />
                    
            <TextBlock Text="Oś Y: " Grid.Row="1" Grid.Column="0"
                       Tag="yAxisAnimation" />
            <Button Content="Start" Grid.Row="1" Grid.Column="1"
                    Click="OnBeginStopButton" />
            <Button Content="Pauza" Grid.Row="1" Grid.Column="2"
                    IsEnabled="False"
                    Click="OnPauseResumeButton" />

            <TextBlock Text="OŚ Z: " Grid.Row="2" Grid.Column="0"
                       Tag="zAxisAnimation" />
            <Button Content="Start" Grid.Row="2" Grid.Column="1"
                    Click="OnBeginStopButton" />
            <Button Content="Pauza" Grid.Row="2" Grid.Column="2"
                    IsEnabled="False"
                    Click="OnPauseResumeButton" />
        </Grid>
    </Grid>
</Page>
