<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:AppStudio.Controls"
    xmlns:html2xaml="using:AppStudio.Controls.Html2Xaml"
    xmlns:commands="using:AppStudio.Commands">

    <!-- ListPhotoLeft -->
    <DataTemplate x:Key="AcercaDeList">
        <Grid>
            <GridView ItemsSource="{Binding PreviewItems}" SelectionMode="None" IsSwipeEnabled="False" IsItemClickEnabled="True" commands:ItemClickCommand.Command="{Binding ItemClickCommand}"
                      ScrollViewer.VerticalScrollBarVisibility="Hidden"
                      ItemTemplate="{StaticResource AcercaDeItem}"/>
            <ProgressBar Height="40" VerticalAlignment="Top" IsIndeterminate="True" Visibility="{Binding ProgressBarVisibility}" />
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="AcercaDeListSnapped">
        <Grid>
            <GridView ItemsSource="{Binding PreviewItems}" SelectionMode="None" IsSwipeEnabled="False" IsItemClickEnabled="True" commands:ItemClickCommand.Command="{Binding ItemClickCommand}"
                      ScrollViewer.VerticalScrollBarVisibility="Hidden"
                      ItemTemplate="{StaticResource AcercaDeItemSnapped}"/>
            <ProgressBar Height="40" VerticalAlignment="Top" IsIndeterminate="True" Visibility="{Binding ProgressBarVisibility}" />
        </Grid>
    </DataTemplate>

    <!-- ListPhotoLeft Item -->
    <DataTemplate x:Key="AcercaDeItem">
        <Grid Width="480" Height="77">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="77"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Source="{Binding Aplicación}" Stretch="UniformToFill" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                <Grid Grid.Column="1" Margin="12,-7,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Style="{StaticResource TitleStyle}" Text="{Binding Nombre}" MaxLines="2"/>
                    <TextBlock Grid.Row="1" Style="{StaticResource SubtitleStyle}" Text="{Binding Autor}" />
                </Grid>
            </Grid>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="AcercaDeItemSnapped">
        <Grid Width="220" Height="77">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="77"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Source="{Binding Aplicación}" Stretch="UniformToFill" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                <Grid Grid.Column="1" Margin="10,-7,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Style="{StaticResource TitleStyle}" Text="{Binding Nombre}" MaxLines="2"/>
                    <TextBlock Grid.Row="1" Style="{StaticResource SubtitleStyle}" Text="{Binding Autor}" />
                </Grid>
            </Grid>
        </Grid>
    </DataTemplate>


    <!-- DetailText -->
    <DataTemplate x:Key="AcercaDe1DetailDetail">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Margin="120,0,40,0" Text="{Binding Nombre}" Style="{StaticResource PageTitleStyle}" MaxLines="1"/>
            <TextBlock Grid.Row="1" Margin="120,12,40,12" Text="{Binding Autor}" Style="{StaticResource TitleStyle}" MaxLines="2"/>
            <ScrollViewer Grid.Row="2" Style="{StaticResource HorizontalScrollViewerStyle}" VerticalContentAlignment="Stretch"
                          ScrollViewer.IsHorizontalScrollChainingEnabled="True" ManipulationMode="All">
                <StackPanel Orientation="Horizontal" Margin="120,0,120,80" VerticalAlignment="Top">
                    <Button Style="{StaticResource ImageButtonStyle}" VerticalAlignment="Top" HorizontalAlignment="Left"
                            Command="{Binding Source={StaticResource ActionCommands}, Path=ShowImage}" CommandParameter="{Binding Aplicación}" 
                            Visibility="{Binding Aplicación, Converter={StaticResource StringVisibilityConverter}}" MaxWidth="480">
                        <Viewbox StretchDirection="DownOnly" Margin="0,0,80,0">
                            <Image Source="{Binding Aplicación}" Stretch="UniformToFill" />
                        </Viewbox>
                    </Button>
                    <controls:RichTextColumns VerticalAlignment="Top">
                        <controls:RichTextColumns.ColumnTemplate>
                            <DataTemplate>
                                <RichTextBlockOverflow Width="400" Margin="0,0,80,0"/>
                            </DataTemplate>
                        </controls:RichTextColumns.ColumnTemplate>
                        <RichTextBlock Width="400" Margin="0,0,80,0" VerticalAlignment="Top"
                                html2xaml:Properties.Html="{Binding Ocupación}" html2xaml:Properties.ContainsCrlf="True"
                                Style="{Binding DataContext.DisplayFontSize, ElementName=Flip, Converter={StaticResource RichDescriptionStyleConverter}}"/>
                    </controls:RichTextColumns>
                </StackPanel>
            </ScrollViewer>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="AcercaDe1DetailDetailSnapped">
        <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" ZoomMode="Disabled">
            <Grid Margin="0,0,20,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <TextBlock Grid.Row="0" Margin="0,12,12,12" Text="{Binding Nombre}" LineStackingStrategy="MaxHeight" Style="{StaticResource PageTitleStyle}" />

                <TextBlock Grid.Row="1" Margin="0,12,12,12" Text="{Binding Autor}"
                           Style="{StaticResource TitleStyle}" LineStackingStrategy="MaxHeight" FontFamily="Segoe UI"/>
                <Viewbox Grid.Row="2" MaxHeight="100" Stretch="Uniform" StretchDirection="DownOnly">
                    <Image Source="{Binding Aplicación}"/>
                </Viewbox>
                <RichTextBlock Grid.Row="5" Margin="0,12,12,0"
                               html2xaml:Properties.Html="{Binding Ocupación}"  html2xaml:Properties.ContainsCrlf="True"
                               Style="{Binding DataContext.DisplayFontSize, ElementName=Flip, Converter={StaticResource RichDescriptionStyleConverter}}"/>
            </Grid>
        </ScrollViewer>
    </DataTemplate>

</ResourceDictionary>
