<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="TELEFONOSDEEMERGENCIA1List">
        <Grid>
            <GridView ItemsSource="{Binding PreviewItems}" SelectionMode="None" IsSwipeEnabled="False" IsItemClickEnabled="True" commands:ItemClickCommand.Command="{Binding ItemClickCommand}"
                      ScrollViewer.VerticalScrollBarVisibility="Hidden"
                      ItemTemplate="{StaticResource TELEFONOSDEEMERGENCIA1Item}"/>
            <ProgressBar Height="40" VerticalAlignment="Top" IsIndeterminate="True" Visibility="{Binding ProgressBarVisibility}" />
        </Grid>
    </DataTemplate>

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

    <!-- ListPhotoLeft Item -->
    <DataTemplate x:Key="TELEFONOSDEEMERGENCIA1Item">
        <Grid Width="480" Height="77">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="77"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Source="{Binding imagen}" 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 Subtitle}" />
                </Grid>
            </Grid>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="TELEFONOSDEEMERGENCIA1ItemSnapped">
        <Grid Width="220" Height="77">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="77"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0" Source="{Binding imagen}" 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 Subtitle}" />
                </Grid>
            </Grid>
        </Grid>
    </DataTemplate>


    <!-- DetailText -->
    <DataTemplate x:Key="TELEFONOSDEEMERGENCIA2DetailDetail">
        <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 Nombre}" 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 imagen}" 
                            Visibility="{Binding imagen, Converter={StaticResource StringVisibilityConverter}}" MaxWidth="480">
                        <Viewbox StretchDirection="DownOnly" Margin="0,0,80,0">
                            <Image Source="{Binding imagen}" Stretch="UniformToFill" />
                        </Viewbox>
                    </Button>
                    <StackPanel Width="400" Margin="0,0,80,0">
                        <Button Margin="0,12" VerticalAlignment="Top" Style="{StaticResource DescriptionCallActionButton}"
                                Command="{Binding Source={StaticResource ActionCommands}, Path=CallToPhone}" CommandParameter="{Binding Subtitle}"
                                Content="{Binding Subtitle}"/>
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="TELEFONOSDEEMERGENCIA2DetailDetailSnapped">
        <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 Nombre}"
                           Style="{StaticResource TitleStyle}" LineStackingStrategy="MaxHeight" FontFamily="Segoe UI"/>
                <Viewbox Grid.Row="2" MaxHeight="100" Stretch="Uniform" StretchDirection="DownOnly">
                    <Image Source="{Binding imagen}"/>
                </Viewbox>
                <Button Grid.Row="4" Margin="0,12" VerticalAlignment="Top" Style="{StaticResource DescriptionCallActionButton}"
                        Command="{Binding Source={StaticResource ActionCommands}, Path=CallToPhone}" CommandParameter="{Binding Subtitle}"
                        Content="{Binding Subtitle}" Foreground="{StaticResource DescriptionForeground}"/>
            </Grid>
        </ScrollViewer>
    </DataTemplate>

</ResourceDictionary>
