<Page
  x:Name="pageRoot" Loaded="OnLoaded" Unloaded="OnUnloaded"
  x:Class="TileSamples.Samples.TwitterFeed"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="using:TileSamples.Samples"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:c1="using:C1.Xaml"
  xmlns:c1tile="using:C1.Xaml.Tile"
  mc:Ignorable="d">
    <Page.Resources>
        <!-- use the same basic style and the same ContentTemplateSelector for all tile types (C1Tile, C1FlipTile, C1SlideTile) -->
        <local:TileTemplateSelector x:Key="TileContentSelector">
            <local:TileTemplateSelector.Resources>
                <ResourceDictionary>
                    <DataTemplate x:Key="BackContentTemplate">
                        <Border Background="DarkSlateBlue">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <!--<TextBlock Text="{Binding Handle}" Foreground="White" Margin="6" FontWeight="Bold"/>-->
                                <TextBlock Grid.Row="1" Text="{Binding Title}" Foreground="White" TextWrapping="Wrap" Margin="20 12"/>
                                <HyperlinkButton Content="{Binding Link}" Foreground="White" Click="HyperlinkButton_Click" FontSize="10" Margin="15 20" Padding="0"/>
                            </Grid>
                        </Border>
                    </DataTemplate>
                    <DataTemplate x:Key="ComponentOne">
                        <Grid Background="#78AA1C">
                            <Image Source="../Images/Twitter_ComponentOne.png" Height="124" Width="124"/>
                        </Grid>
                    </DataTemplate>
                    <DataTemplate x:Key="Wijmo">
                        <Grid Background="#900099">
                            <Image Source="../Images/Twitter_Wijmo.png" Height="124" Width="124"/>
                        </Grid>
                    </DataTemplate>
                    <DataTemplate x:Key="DocToHelp">
                        <Grid Background="#D44A28">
                            <Image Source="../Images/Twitter_DocToHelp.png" Height="140" Width="140"/>
                        </Grid>
                    </DataTemplate>
                </ResourceDictionary>
            </local:TileTemplateSelector.Resources>
        </local:TileTemplateSelector>

        <Style TargetType="c1tile:C1Tile" x:Key="baseStyle">
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="HeaderPadding" Value="5 10"/>
            <Setter Property="HeaderForeground" Value="White"/>
            <Setter Property="HeaderFontSize" Value="20"/>
            <Setter Property="HorizontalHeaderAlignment" Value="Stretch"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="Height" Value="210"/>
            <Setter Property="Width" Value="300"/>
            <Setter Property="Margin" Value="8"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="c1tile:C1TileService.PointerDownAnimation" Value="True"/>
        </Style>
        <Style TargetType="c1tile:C1Tile" BasedOn="{StaticResource baseStyle}"/>
        <Style TargetType="c1tile:C1SlideTile" BasedOn="{StaticResource baseStyle}"/>
        <Style TargetType="c1tile:C1FlipTile" BasedOn="{StaticResource baseStyle}"/>
    </Page.Resources>
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Button x:Name="retry" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="18" Content="Retry" Grid.Row="0" Click="Retry_Click" Visibility="Collapsed"/>
        <ScrollViewer VerticalScrollBarVisibility="Auto" x:Name="sv" Grid.Row="1" >
            <c1:C1WrapPanel x:Name="tilePanel" >
                <c1tile:C1Tile Header="ComponentOne">
                    <c1tile:C1Tile.Content>
                        <Grid Background="#78AA1C">
                            <Image Source="../Images/Twitter_ComponentOne.png" Height="124" Width="124"/>
                            <TextBlock Text="Loading..." FontSize="16" Foreground="White" TextAlignment="Center" VerticalAlignment="Top"/>
                        </Grid>
                    </c1tile:C1Tile.Content>
                </c1tile:C1Tile>
                <c1tile:C1FlipTile Header="Wijmo">
                    <c1tile:C1Tile.Content>
                        <Grid Background="#900099">
                            <Image Source="../Images/Twitter_Wijmo.png" Height="124" Width="124"/>
                            <TextBlock Text="Loading..." FontSize="16" Foreground="White" TextAlignment="Center" VerticalAlignment="Top"/>
                        </Grid>
                    </c1tile:C1Tile.Content>
                </c1tile:C1FlipTile>
                <c1tile:C1SlideTile Header="DocToHelp">
                    <c1tile:C1Tile.Content>
                        <Grid Background="#D44A28">
                            <Image Source="../Images/Twitter_DocToHelp.png" Height="124" Width="124"/>
                            <TextBlock Text="Loading..." FontSize="16" Foreground="White" TextAlignment="Center" VerticalAlignment="Top"/>
                        </Grid>
                    </c1tile:C1Tile.Content>
                </c1tile:C1SlideTile>
            </c1:C1WrapPanel>
        </ScrollViewer>
    </Grid>
</Page>
