<Page DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Style="{StaticResource A_Style_Page_Generic}"
      mc:Ignorable="d"
      x:Class="ForzaUI.A_PopupBuyTokens"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:ForzaUI"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Popup}"/>
    </local:UIPageTransitionManager.TransitionManager>

    <Page.Resources>
        <ResourceDictionary>

            <Style x:Key="A_Style_FZTextBlock_OptionText_GreenText" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_OptionText}">
                <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text_Alternate}" />
            </Style>

            <DataTemplate x:Key="A_DataTemplate_TextMenu_Tokens">
                <Grid Focusable="True">
                    <StackPanel HorizontalAlignment="Left"
                                Orientation="Horizontal" Height="48">
                        <local:FZTextBlock MaxWidth="190"
                                           Style="{StaticResource A_Style_FZTextBlock_OptionText}"
                                           Text="{Binding BaseTokenCount}" />
                        <local:FZTextBlock Margin="-11, 0, 0, 0"
                                           MaxWidth="190"
                                           Style="{StaticResource A_Style_FZTextBlock_OptionText_GreenText}"
                                           Text="{Binding FreeTokenCount}" >
                        </local:FZTextBlock>

                         
                    </StackPanel>
                    <local:FZTextBlock HorizontalAlignment="Right"
                                       MaxWidth="150"
                                       FontFamily="Horizon_C"
                                       Style="{StaticResource A_Style_FZTextBlock_OptionText}"
                                       Text="{Binding Price}" />
                </Grid>
            </DataTemplate>
        </ResourceDictionary>
    </Page.Resources>

    <Grid>
        <!-- Background Blur -->
        <local:FZMaterialGlassCapture />
        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Popup_Background}"/>

        <!-- Help Button Bar -->
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="DefaultHelpPanel"
                            local:ControllerButtonPanel.ADescription="{local:Loc HelpButtons.IDS_Select}"
                            local:ControllerButtonPanel.BDescription="{local:Loc HelpButtons.IDS_Back}"
                            Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>


        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}" Visibility="{Binding TokenPacksLoaded, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden}}">
            <StackPanel x:Name="MainContent"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Width="{StaticResource A_Double_MessageBox_Width}"
                        Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">

                <ContentControl Content="{local:Loc InGameMarketplace.IDS_TokenPurchaseTitle}"
                          Style="{StaticResource A_Style_ContentControl_PopupTitleBlock}"/>

                <ContentControl Style="{StaticResource A_Style_ContentControl_PopupContentBlock}" Tag="/ForzaUI;component/Textures/Anthem/Icons/Titles/PopupMessageBox.png">
                    <StackPanel Orientation="Vertical">
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PopupText}"
                                           Text="{local:Loc InGameMarketplace.IDS_TokenPurchaseDescription}" />
                        <Decorator VerticalAlignment="Bottom" Margin="0,20,0,0">
                            <local:CommonListBox ItemTemplate="{StaticResource A_DataTemplate_TextMenu_Tokens}"
                                                    ItemsSource="{Binding TokenPacks}"
                                                    Style="{StaticResource A_Style_ListBox_TextMenu_Default}"
                                                    x:Name="Menu"
                                                    local:FocusOnPageFocusGained.SelectorSelectedItem="True"/>
                        </Decorator>
                    </StackPanel>
                </ContentControl>
            </StackPanel>
        </Grid>
    </Grid>
</Page>
