<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="EAT_IT.EigenesRezeptSpeichern"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:EAT_IT"
    xmlns:common="using:EAT_IT.Common"
    xmlns:Controls="using:Callisto.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid Style="{StaticResource LayoutRootStyle}">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="Rezept speichern" Style="{StaticResource PageHeaderTextStyle}"/>
            <Button Name="Speichern" Content="Speichern" Grid.Column="1" HorizontalAlignment="Left" Margin="1078,56,0,0" VerticalAlignment="Top" Height="48" Width="158" Click="Speichere"/>
        </Grid>
        <Grid HorizontalAlignment="Left" Height="608" Margin="10,10,0,0" Grid.Row="1" VerticalAlignment="Top" Width="664">
            <TextBox Name="TitelBox"  HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Titel" VerticalAlignment="Top" Height="16" Width="644" GotFocus="AnwahlTitel"/>
            <TextBox Name="Schwierigkeit" HorizontalAlignment="Left" Margin="10,239,0,0" TextWrapping="Wrap" Text="Schwierigkeit" VerticalAlignment="Top" Width="644" GotFocus="AnwahlSchwierigkeit"/>
            <TextBox Name="Kurzbeschreibung" HorizontalAlignment="Left" Margin="10,131,0,0" TextWrapping="Wrap" Text="Kurzbeschreibung" VerticalAlignment="Top" RenderTransformOrigin="0.385,2.979" Height="90" Width="644" GotFocus="AnwahlKurzbeschreibung"/>
            <Controls:Rating Name="Rate" Visibility="Visible"  Value="3" ItemCount="6" Background="Transparent" Foreground="Silver" FontSize="15" HorizontalAlignment="Left" Margin="44,42,0,0" VerticalAlignment="Top" Height="76"/>
            <Button Name="BildLaden" Content="Bild hinzufügen" HorizontalAlignment="Left" Margin="374,47,0,0" VerticalAlignment="Top" Width="280" Height="79" Click="BildOeffnen"/>
            <TextBox HorizontalAlignment="Left" Margin="10,77,0,0" TextWrapping="Wrap" Text="Rating:" VerticalAlignment="Top" Background="{StaticResource ButtonBackgroundThemeBrush}" Foreground="{StaticResource ApplicationForegroundThemeBrush}" FontSize="18" BorderBrush="{StaticResource BackButtonBackgroundThemeBrush}"/>
            <TextBox Name="Zutaten" HorizontalAlignment="Left" Margin="10,290,0,0" TextWrapping="Wrap" Text="Zutaten. Verschiedene Zutaten bitte durch Zeilensprung trennen." VerticalAlignment="Top" Height="308" Width="644" GotFocus="AnwahlZutaten" AcceptsReturn="True"/>


        </Grid>
        <Grid HorizontalAlignment="Left" Height="608" Margin="679,10,0,0" Grid.Row="1" VerticalAlignment="Top" Width="677">
            <TextBox Name="Beschreibung" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Beschreibung" VerticalAlignment="Top" Height="588" Width="657" GotFocus="AnwahlBeschreibung" AcceptsReturn="True"/>
        </Grid>

        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
