<Page
    x:Class="UniversalApp4.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UniversalApp4"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Page.Resources>
        <DataTemplate x:Key="FlipViewTemplate">
            <StackPanel Orientation="Horizontal">
                <Image Width="640" Height="480" Source="{Binding 画像名}"/>
                <TextBlock Width="320" TextAlignment="Left" Text="{Binding 説明}" FontFamily="Meiryo UI" FontSize="24" TextWrapping="Wrap" Padding="5"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="FlipViewPhoneTemplate">
            <StackPanel Orientation="Vertical">
                <Image Width="320" Height="240" Source="{Binding 画像名}" HorizontalAlignment="Left"/>
                <TextBlock Width="320" TextAlignment="Left" Text="{Binding 説明}" FontFamily="Meiryo UI" FontSize="24" TextWrapping="Wrap" Padding="5" HorizontalAlignment="Left"/>
            </StackPanel>
        </DataTemplate>
    </Page.Resources>
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="WideState">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="600" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="FlipView1.ItemTemplate"
                            Value="{StaticResource FlipViewTemplate}" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="NarrowState">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="FlipView1.ItemTemplate"
                            Value="{StaticResource FlipViewPhoneTemplate}" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <FlipView x:Name="FlipView1" HorizontalAlignment="Left" Height="480" VerticalAlignment="Top" Width="959"/>
    </Grid>
</Page>
