<local:MusicContentPage
    x:Class="was.touchcopy.features.music.MusicContentArtistsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:was.touchcopy.features.music"
    xmlns:data="using:was.touchcopy.features.music.data"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
    NavigationCacheMode="Enabled">
    <Grid>
      
        <GridView x:Name="gridViewArtists" ItemsSource="{x:Bind ArtistGroups.View, Mode=OneWay}" SelectionMode="Extended" 
                  PreviewKeyDown="GridViewArtists_PreviewKeyDown" ContainerContentChanging="GridViewArtists_ContainerContentChanging">
            <GridView.GroupStyle>
                <GroupStyle HidesIfEmpty="True">
                    <GroupStyle.HeaderTemplate>
                        <DataTemplate x:DataType="data:ArtistGroup">
                            <TextBlock Text="{Binding Key}" Foreground="{ThemeResource SystemAccentColor}" />
                        </DataTemplate>
                    </GroupStyle.HeaderTemplate>
                </GroupStyle>
            </GridView.GroupStyle>
            <GridView.ItemTemplate>
                <DataTemplate x:DataType="data:Artist">
                    <StackPanel Padding="5" Height="200" IsDoubleTapEnabled="True" DoubleTapped="GridViewItem_DoubleTapped" DataContext="{x:Bind}" Background="#00FFFFFF">
                        <Border Width="150" Height="150" CornerRadius="75" Background="{ThemeResource TextFillColorInverse}" PointerEntered="Border_PointerEntered" PointerExited="Border_PointerExited">
                            <Grid>
                                <FontIcon x:Name="placeholderFontIcon" Glyph="&#xE77B;" FontSize="28" Opacity=".8" />
                                <Image x:Name="artistImage" Width="150" Height="150" Stretch="UniformToFill" VerticalAlignment="Center" HorizontalAlignment="Center" />
                                <Border x:Name="artistPlayButton" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="10" CornerRadius="64" Background="{ThemeResource TextFillColorInverse}" Visibility="Collapsed" Tapped="ArtistPlayButton_Tapped" DataContext="{x:Bind}">
                                    <FontIcon Glyph="&#xE768;" />
                                </Border>
                            </Grid>
                        </Border>
                        <TextBlock Text="{x:Bind Name}" TextWrapping="WrapWholeWords" MaxLines="2" TextTrimming="CharacterEllipsis" FontWeight="SemiBold" FontSize="14" Margin="5,2,5,0" TextAlignment="Center" />
                        <StackPanel.ContextFlyout>
                            <MenuFlyout Opening="GridViewItemMenuFlyout_Opening">
                                <MenuFlyoutItem x:Uid="MenuFlyoutItemPlay" Text="Play" Click="GridViewMenuPlay_Click">
                                    <MenuFlyoutItem.Icon>
                                        <FontIcon Glyph="&#xE768;" />
                                    </MenuFlyoutItem.Icon>
                                </MenuFlyoutItem>
                                <MenuFlyoutSeparator />
                                <MenuFlyoutItem x:Uid="MenuFlyoutItemCopy" Text="Copy" Click="GridViewMenuCopyToPC_Click">
                                    <MenuFlyoutItem.Icon>
                                        <FontIcon Glyph="&#xE8C8;" />
                                    </MenuFlyoutItem.Icon>
                                </MenuFlyoutItem>
                                <MenuFlyoutItem Name="MenuFlyoutItemITunes" x:Uid="MenuFlyoutItemITunes" Text="iTunes" Click="GridViewMenuCopyToITunes_Click">
                                    <MenuFlyoutItem.Icon>
                                        <FontIcon Glyph="&#xE90B;" />
                                    </MenuFlyoutItem.Icon>
                                </MenuFlyoutItem>
                                <MenuFlyoutItem Name="MenuFlyoutItemAppleMusic" x:Uid="MenuFlyoutItemAppleMusic" Text="AppleMusic" Click="GridViewMenuCopyToAppleMusic_Click">
                                    <MenuFlyoutItem.Icon>
                                        <FontIcon Glyph="&#xE90B;" />
                                    </MenuFlyoutItem.Icon>
                                </MenuFlyoutItem>
                            </MenuFlyout>
                        </StackPanel.ContextFlyout>
                    </StackPanel>
                </DataTemplate>
            </GridView.ItemTemplate>
        </GridView>
        <Border HorizontalAlignment="Right" VerticalAlignment="Bottom"  Background="Transparent" Padding="10,0,0,10">
            <StackPanel>
                <TextBlock x:Uid="TextBlockArtistsFromSpotify" Text="Artist images from" HorizontalAlignment="Center" FontWeight="Bold"/>
                <Button x:Name="buttonSpotify" Click="ButtonSpotify_Click" BorderBrush="Transparent" Background="Transparent">
                    <Image Source="resources/Spotify_Logo.png" Height="30"  Stretch="Uniform"/>
                </Button>
               
            </StackPanel>
        </Border>
        <Grid x:Name="gridNoResults" Visibility="Collapsed">
            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <TextBlock x:Name="textBlockNoResults" x:Uid="TextBlockNoResultsArtists" Text="No results found." FontSize="18" FontStyle="Italic" FontWeight="SemiLight" Opacity=".7"/>
            </StackPanel>
        </Grid>
        <ContentDialog x:Name="contentDialogInvalidOperation" x:Uid="ContentDialogInvalidOperation" CloseButtonText="Dismiss" DefaultButton="Close">
            <TextBlock x:Name="textBlockInvalidOperation" TextWrapping="Wrap" />
        </ContentDialog>
    </Grid>
</local:MusicContentPage>
