<Page x:Class="ForzaUI.PlayerLevelTestMenu"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      mc:Ignorable="d"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <Page.Resources>
        <ResourceDictionary>
            <Style x:Key="A_Style_FrameworkElement_PlayerLevelTestsContainer" TargetType="{Type FrameworkElement}">
                <Setter Property="Margin" Value="2"/>
            </Style>
            <Style x:Key="A_Style_ItemsControl_PlayerLevelTests" TargetType="{Type ItemsControl}">
                <Setter Property="ItemsSource" Value="{Binding UserProfiles}"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <ItemsPresenter />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="ItemsPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <UniformGrid IsItemsHost="True"
                                Columns="{Binding MaxTierNum}"
                                Rows="{Binding MaxPrestigeNum}"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="ItemContainerStyle" Value="{StaticResource A_Style_FrameworkElement_PlayerLevelTestsContainer}">
                </Setter>
            </Style>
        </ResourceDictionary>
    </Page.Resources>

    <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
        <UniformGrid Rows="1">
            <ItemsControl Style="{StaticResource A_Style_ItemsControl_PlayerLevelTests}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Control Template="{StaticResource A_ControlTemplate_PlayerLevel_WithPrestige}"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
            <ItemsControl Style="{StaticResource A_Style_ItemsControl_PlayerLevelTests}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <ContentControl x:Name="Shine" Style="{StaticResource A_Style_ContentControl_PlayerLevel_WithPrestige_SheenWrapper}">
                            <Control Template="{StaticResource A_ControlTemplate_PlayerLevel_WithPrestige}"/>
                        </ContentControl>
                        <DataTemplate.Triggers>
                            <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                                <BeginUIStoryboard>
                                    <UIStoryboard RepeatBehavior="Forever" Duration="0:0:1.0">
                                        <UIStoryboard.TriggerAnimation>
                                            <RaiseFzEvent Storyboard.TargetName="Shine" EventName="Shine" local:TriggerAnimation.KeyTime="0:0:0.0"/>
                                        </UIStoryboard.TriggerAnimation>
                                    </UIStoryboard>
                                </BeginUIStoryboard>
                            </EventTrigger>
                        </DataTemplate.Triggers>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </UniformGrid>
    </Grid>
</Page>
