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

    <Grid Background="{StaticResource AppBackgroundColorBrush}">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="PageOrientationStates">
                <VisualState x:Name="Landscape">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Flip" Storyboard.TargetProperty="ItemTemplate">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource LandscapeParentesis1DetailDetail}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Portrait" />
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <FlipView x:Name="Flip" Grid.Row="0" AutomationProperties.AutomationId="ItemsFlipView" AutomationProperties.Name="Item Details" TabIndex="1"
                  DataContext="{Binding ParentesisModel}"
                  d:DataContext="{d:DesignData Source=/Assets/Data/ParentesisDataSource.json, Type=vm:ParentesisViewModel, IsDesignTimeCreatable=true}"
                  ItemsSource="{Binding Items}"
                  ItemTemplate="{StaticResource Parentesis1DetailDetail}"
                  SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
        </FlipView>

    </Grid>

    <Page.BottomAppBar>
        <CommandBar ClosedDisplayMode="Minimal" Visibility="{Binding ParentesisModel.AppBarVisibility}" Background="{StaticResource AppBarBackground}" Foreground="{StaticResource AppBarForeground}">
            <AppBarButton x:Uid="TextToSpeechButton" Icon="Volume" DataContext="{Binding ParentesisModel}" Command="{Binding TextToSpeechCommand}" Visibility="{Binding TextToSpeechVisibility}"/>
            <AppBarButton x:Uid="RefreshButton" Icon="Refresh" DataContext="{Binding ParentesisModel}" Command="{Binding RefreshCommand}" Visibility="{Binding RefreshVisibility}"/>
            <AppBarButton x:Uid="GoToSourceButton" Icon="Globe" DataContext="{Binding ParentesisModel}" Command="{Binding GoToSourceCommand}" Visibility="{Binding GoToSourceVisibility}"/>
            <CommandBar.SecondaryCommands>
                <AppBarButton x:Uid="ShareItemButton" Label="share item" DataContext="{Binding ParentesisModel}" Command="{Binding ShareItemCommand}" Visibility="{Binding ShareItemVisibility}"/>
            </CommandBar.SecondaryCommands>
        </CommandBar>
    </Page.BottomAppBar>
</Page>
