<UserControl
    x:Class="StockPortfolio.FunctionGroupPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:StockPortfolio"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Name="MainPage"
    xmlns:c1tile="using:C1.Xaml.Tile"
    d:DesignHeight="300"
    d:DesignWidth="400">
    <UserControl.Resources>
        <local:TileTemplateSelector x:Key="TileContentSelector">
            <local:TileTemplateSelector.Resources>
                <ResourceDictionary>
                    <DataTemplate x:Key="Style1">
                        <c1tile:C1Tile Content="1" Margin="5" Header="{Binding Title}" HeaderPadding="12" Padding="0" HeaderBackground="#22000000" HorizontalHeaderAlignment="Stretch" />
                    </DataTemplate>
                    <DataTemplate x:Key="Style2">
                        <c1tile:C1SlideTile Content="2" HeaderPadding="12" Margin="5"
                                       HorizontalContentAlignment="Stretch" 
                                       VerticalContentAlignment="Stretch" Padding="0" Header="C1SlideTile">
                            <c1tile:C1Tile.ContentTemplate>
                                <DataTemplate>
                                    <Border Background="#FFBC1C48" >
                                        <TextBlock Text="{Binding Title}" VerticalAlignment="Center" HorizontalAlignment="Center" />
                                    </Border>
                                </DataTemplate>
                            </c1tile:C1Tile.ContentTemplate>
                            <c1tile:C1Tile.BackContentTemplate>
                                <DataTemplate>
                                    <Border Background="#FF028541" >
                                        <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                                            <TextBlock Text="{Binding Title}" Foreground="White" HorizontalAlignment="Center"/>
                                            <TextBlock Text="Back Content Template" Margin="0 -10 0 0" FontSize="12" Foreground="White"  HorizontalAlignment="Center"/>
                                        </StackPanel>
                                    </Border>
                                </DataTemplate>
                            </c1tile:C1Tile.BackContentTemplate>
                        </c1tile:C1SlideTile>
                    </DataTemplate>
                    <DataTemplate x:Key="Style3">
                        <c1tile:C1SlideTile Content="3" BackContent="Back Content 3" FontSize="36" Header="C1SlideTile" HeaderPadding="12" Padding="0"/>
                    </DataTemplate>
                    <DataTemplate x:Key="Style4">
                        <c1tile:C1SlideTile Content="4" Header="C1SlideTile, SlideDirection = Right" HeaderPadding="12" Padding="0" SlideDirection="Right" HorizontalHeaderAlignment="Right"/>
                    </DataTemplate>
                    <DataTemplate x:Key="Style5">
                        <c1tile:C1SlideTile Content="5" Header="C1SlideTile" />
                    </DataTemplate>
                    <DataTemplate x:Key="Style6">
                        <c1tile:C1FlipTile Content="6" Header="C1FlipTile" />
                    </DataTemplate>
                    <DataTemplate x:Key="Style7">
                        <c1tile:C1FlipTile Content="7" Header="C1FlipTile" HeaderPadding="12" Padding="0" HeaderBackground="#22000000">
                            <c1tile:C1Tile.ContentTemplate>
                                <DataTemplate>
                                    <Border Background="#FF8C0095" >
                                        <TextBlock Text="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Center" />
                                    </Border>
                                </DataTemplate>
                            </c1tile:C1Tile.ContentTemplate>
                            <c1tile:C1Tile.BackContentTemplate>
                                <DataTemplate>
                                    <Border Background="#FFCD4900" >
                                        <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                                            <TextBlock Text="{Binding}"  Foreground="White" HorizontalAlignment="Center"/>
                                            <TextBlock Text="Back Content Template" Margin="0 -10 0 0" FontSize="12" Foreground="White" HorizontalAlignment="Center"/>
                                        </StackPanel>
                                    </Border>
                                </DataTemplate>
                            </c1tile:C1Tile.BackContentTemplate>
                        </c1tile:C1FlipTile>
                    </DataTemplate>
                </ResourceDictionary>
            </local:TileTemplateSelector.Resources>
        </local:TileTemplateSelector>
    </UserControl.Resources>
    <local:C1GridView ItemsSource="{Binding Groups}" DataContext="{Binding DataContext,ElementName=MainPage}"  x:Name="gridView" AllowDrop="True" ItemTemplateSelector="{StaticResource TileContentSelector}"
                                CanReorderItems="True" CanDragItems="True" IsSwipeEnabled="True" >
            <local:C1GridView.ItemContainerStyle>
                <Style TargetType="GridViewItem">
                    <Setter Property="c1tile:C1TileService.PointerDownAnimation" Value="True"/>
                </Style>
            </local:C1GridView.ItemContainerStyle>
            <!--<local:C1GridView.ItemContainerStyleSelector>
            
        </local:C1GridView.ItemContainerStyleSelector>-->
            <!--<local:C1GridView.ItemTemplate>
            <DataTemplate>
                <c1tile:C1Tile Content="{Binding Title}" Header="{Binding Header}"/>
            </DataTemplate>
        </local:C1GridView.ItemTemplate>-->
        </local:C1GridView>
 
</UserControl>
