<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="ForzaUI.Scenes.Anthem.A_FileOptions"
    Style="{StaticResource A_Style_Page_Generic}"
    DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <UIPageTransitionManager.TransitionManager>
        <UIPageTransitionManager
            Preset="{StaticResource A_UIPageTransitionManagerPreset_Popup}" />
    </UIPageTransitionManager.TransitionManager>
    <Page.Resources>
        <ResourceDictionary>
            <Color
                x:Key="A_Color_Element">#FFFFFFFF</Color>
            <Color
                x:Key="A_Color_Divider">#FF969696</Color>
            <Color
                x:Key="A_Color_FileName">#FFFFFFFF</Color>
            <Double
                x:Key="A_Divider_Width">2</Double>
            <Style
                x:Key="A_Style_FZTextBlock_TitleElement"
                TargetType="{Type local:FZTextBlock}"
                BasedOn="{StaticResource A_Style_FZTextBlock_Heading_ExtraSmallInactive}">
                <Setter
                    Property="Margin"
                    Value="0" />
                <Setter
                    Property="HorizontalAlignment"
                    Value="Left" />
                <Setter
                    Property="VerticalAlignment"
                    Value="Top" />
                <Setter
                    Property="CapHeight"
                    Value="18" />
                <Setter
                    Property="Color"
                    Value="{StaticResource H_Color_Primary_Grey_80pc}" />
            </Style>
            <Style
                x:Key="A_Style_FZTextBlock_InfoElement"
                TargetType="{Type local:FZTextBlock}"
                BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
                <Setter
                    Property="Margin"
                    Value="0" />
                <Setter
                    Property="HorizontalAlignment"
                    Value="Left" />
                <Setter
                    Property="VerticalAlignment"
                    Value="Top" />
                <Setter
                    Property="Color"
                    Value="{StaticResource H_Color_Primary_White}" />
                <Setter
                    Property="CapHeight"
                    Value="28" />
            </Style>
            <Style
                x:Key="A_Style_FZTextBlock_FileNameElement"
                TargetType="{Type local:FZTextBlock}"
                BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
                <Setter
                    Property="HorizontalAlignment"
                    Value="Left" />
                <Setter
                    Property="VerticalAlignment"
                    Value="Top" />
                <Setter
                    Property="Color"
                    Value="{StaticResource A_Color_FileName}" />
                <Setter
                    Property="TextWrapping"
                    Value="Wrap" />
                <Setter
                    Property="CapHeight"
                    Value="25" />
            </Style>
            <Style
                x:Key="A_Style_FZMaterial_Divider"
                TargetType="{Type local:FZMaterial}">
                <Setter
                    Property="Color"
                    Value="{StaticResource A_Color_Divider}" />
                <Setter
                    Property="Margin"
                    Value="-10,0,10,0" />
            </Style>
            <Style
                x:Key="A_Style_FZMaterial_PopularityBacking"
                TargetType="{Type local:FZMaterial}">
                <Setter
                    Property="Color"
                    Value="{StaticResource H_Color_Glass_Purple_40pc}" />
                <Setter
                    Property="Preset"
                    Value="{StaticResource A_FZMaterialPresetGlass_Low}" />
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding FileType}"
                        Value="7">
                        <Setter
                            Property="Color"
                            Value="#66000000" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <Style
                x:Key="A_Style_DockPanel_ShareStats"
                TargetType="{Type DockPanel}">
                <Setter
                    Property="LastChildFill"
                    Value="False" />
                <Setter
                    Property="Margin"
                    Value="0,25,0,0" />
            </Style>
            <Style
                x:Key="A_Style_DockPanel_DownloadStats"
                BasedOn="{StaticResource A_Style_DockPanel_ShareStats}"
                TargetType="{Type DockPanel}">
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding ShowShareStats}"
                        Value="False">
                        <Setter
                            Property="Visibility"
                            Value="Collapsed" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <Style
                x:Key="A_Style_DockPanel_UsageStats"
                BasedOn="{StaticResource A_Style_DockPanel_ShareStats}"
                TargetType="{Type DockPanel}">
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding ShowShareStats}"
                        Value="False">
                        <Setter
                            Property="Visibility"
                            Value="Collapsed" />
                    </DataTrigger>
                    <DataTrigger
                        Binding="{Binding ShowUsageStats}"
                        Value="False">
                        <Setter
                            Property="Visibility"
                            Value="Collapsed" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <Style
                x:Key="A_Style_DockPanel_LikeStats"
                BasedOn="{StaticResource A_Style_DockPanel_ShareStats}"
                TargetType="{Type DockPanel}">
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding ShowShareStats}"
                        Value="False">
                        <Setter
                            Property="Visibility"
                            Value="Collapsed" />
                    </DataTrigger>
                    <DataTrigger
                        Binding="{Binding ShowLikeStats}"
                        Value="False">
                        <Setter
                            Property="Visibility"
                            Value="Collapsed" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <Style
                x:Key="A_Style_FZMaterial_Thumbnail"
                TargetType="{Type local:FZMaterial}">
                <Setter
                    Property="Stretch"
                    Value="Uniform" />
                <Setter
                    Property="StretchDirection"
                    Value="Both" />
                <Setter
                    Property="GreedyMeasure"
                    Value="True" />
                <Setter
                    Property="HorizontalAlignment"
                    Value="Center" />
                <Setter
                    Property="Visibility"
                    Value="{Binding ShouldShowThumbnail, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
                <Setter
                    Property="Height"
                    Value="280" />
                <Setter
                    Property="Margin"
                    Value="0,-60,0,120" />
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding FileType}"
                        Value="2"> 
                        <!-- LayerGroup -->
                        <Setter
                            Property="Height"
                            Value="170" />
                        <Setter
                            Property="Width"
                            Value="170" />
                        <Setter
                            Property="Width"
                            Value="170" />
                        <Setter
                            Property="GreedyMeasure"
                            Value="False" />
                        <Setter
                            Property="VerticalAlignment"
                            Value="Top" />
                        <Setter
                            Property="Margin"
                            Value="0,28,0,86" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition
                                Binding="{Binding FileType}"
                                Value="2" />
                                <!-- LayerGroup -->
                            <Condition
                                Binding="{Binding ShowShareStats}"
                                Value="True" />
                        </MultiDataTrigger.Conditions>
                        <Setter
                            Property="Margin"
                            Value="0,28,0,130" />
                    </MultiDataTrigger>
                    <DataTrigger
                        Binding="{Binding FileType}"
                        Value="3">
                        <!-- Livery -->
                        <Setter
                            Property="Height"
                            Value="300" />
                        <Setter
                            Property="Stretch"
                            Value="Uniform" />
                        <Setter
                            Property="Margin"
                            Value="-10,0,0,40" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition
                                Binding="{Binding FileType}"
                                Value="3" />
                            <Condition
                                Binding="{Binding ShowShareStats}"
                                Value="True" />
                        </MultiDataTrigger.Conditions>
                        <Setter
                            Property="Margin"
                            Value="-10,0,0,90" />
                    </MultiDataTrigger>
                    <DataTrigger
                        Binding="{Binding FileType}"
                        Value="4">
                        <!-- BaseLivery -->
                        <Setter
                            Property="Height"
                            Value="300" />
                        <Setter
                            Property="Stretch"
                            Value="Uniform" />
                        <Setter
                            Property="Margin"
                            Value="-10,0,0,40" />
                    </DataTrigger>
                    <DataTrigger
                        Binding="{Binding FileType}"
                        Value="6">
                        <!-- BaseLivery -->
                        <Setter
                            Property="Height"
                            Value="340" />
                        <Setter
                            Property="Stretch"
                            Value="UniformToFill" />
                        <Setter
                            Property="Margin"
                            Value="0,0,0,0" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition
                                Binding="{Binding FileType}"
                                Value="4" />
                            <Condition
                                Binding="{Binding ShowShareStats}"
                                Value="True" />
                        </MultiDataTrigger.Conditions>
                        <Setter
                            Property="Margin"
                            Value="-10,0,0,90" />
                    </MultiDataTrigger>
                    <DataTrigger
                        Binding="{Binding FileType}"
                        Value="5">
                        <!-- SoulBoundLivery -->
                        <Setter
                            Property="Height"
                            Value="300" />
                        <Setter
                            Property="Stretch"
                            Value="Uniform" />
                        <Setter
                            Property="Margin"
                            Value="-10,0,0,40" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition
                                Binding="{Binding FileType}"
                                Value="5" />
                        <!-- SoulBoundLivery -->
                            <Condition
                                Binding="{Binding ShowShareStats}"
                                Value="True" />
                        </MultiDataTrigger.Conditions>
                        <Setter
                            Property="Margin"
                            Value="-10,0,0,90" />
                    </MultiDataTrigger>
                    <DataTrigger
                        Binding="{Binding FileType}"
                        Value="11">
                        <!-- Count? -->
                        <Setter
                            Property="Stretch"
                            Value="None" />
                             <Setter
                            Property="Margin"
                            Value=" 0,20,0,80" />
                        <Setter
                            Property="Height"
                            Value="auto" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition
                                Binding="{Binding FileType}"
                                Value="11" />
                            <Condition
                                Binding="{Binding ShowShareStats}"
                                Value="True" />
                        </MultiDataTrigger.Conditions>
                         <Setter
                            Property="Stretch"
                            Value="None" />
                        <Setter
                            Property="Margin"
                            Value="0" />
                        <Setter
                            Property="Height"
                            Value="auto" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>
            <DataTemplate
                x:Key="A_DataTemplate_TextMenu_FileOption">
                <Grid
                    IsHitTestVisible="False"
                    Height="{StaticResource A_Double_TextMenu_Height_Default}">
                    <FZTextBlock
                        Text="{Binding Text}"
                        Style="{StaticResource A_Style_FZTextBlock_OptionText}"
                        TextAlignment="Center" />
                </Grid>
            </DataTemplate>
        </ResourceDictionary>
    </Page.Resources>
    <Grid
        x:Name="PART_LayoutRoot">
        <FZMaterialGlassCapture />
        <FZMaterial
            Style="{StaticResource A_Style_FZMaterial_Popup_Background}" />
        <PlayerBarControl
            x:Name="TopBar"
            Style="{StaticResource A_Style_PlayerBarControl}" />
        <ContentControl
            x:Name="BottomBar"
            Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl
                x:Name="PART_DefaultHelpPanel"
                Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>
        <Grid
            Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <StackPanel
                x:Name="MainContent"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}"
                Width="{StaticResource H_Width_PopUp}">
                <ContentControl
                    Style="{StaticResource A_Style_ContentControl_PopupTitleBlock}"
                    Content="{Loc Main.IDS_LoadSave_FileOptions}" />
                <ContentControl
                    Style="{StaticResource A_Style_ContentControl_PopupContentBlock_IconFront}"
                    Tag="/ForzaUI;component/Textures/Anthem/Icons/Titles/PopupSettings.png">
                    <Decorator
                        Height="Auto"
                        Width="Auto">
                        <DockPanel
                            LastChildFill="False">
                            <StackPanel
                                DockPanel.Dock="Bottom"
                                Visibility="{Binding ShowDescription, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                Margin="24,0,24,24">
                                <FZTextBlock
                                    Text="{Loc Storefront.IDS_LabelDescription}"
                                    Style="{StaticResource A_Style_FZTextBlock_TitleElement}"
                                    Margin="0,0,0,4" />
                                <FZTextBlock
                                    Text="{Binding Description}"
                                    Style="{StaticResource A_Style_FZTextBlock_Body}"
                                    Color="{StaticResource A_Color_Body_Text}"
                                    CapHeight="15"
                                    Margin="0,8,0,0"
                                    TextWrapping="Wrap"
                                    MaxHeight="200" />
                            </StackPanel>
                            <StackPanel
                                DockPanel.Dock="Bottom"
                                Margin="24,24,24,24">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition
                                            Width="*" />
                                        <ColumnDefinition
                                            Width="*" />
                                        <ColumnDefinition
                                            Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition
                                            Height="*" />
                                        <RowDefinition
                                            Height="*" />
                                    </Grid.RowDefinitions>
                                    <StackPanel
                                        Grid.Column="0"
                                        Grid.Row="0">
                                        <FZTextBlock
                                            Text="{Loc Storefront.IDS_LabelCreator}"
                                            Style="{StaticResource A_Style_FZTextBlock_TitleElement}"
                                            Margin="0,0,0,8" />
                                        <FZTextBlock
                                            Text="{Binding Creator.FormattedGamertag}"
                                            Style="{StaticResource A_Style_FZTextBlock_InfoElement}" />
                                    </StackPanel>
                                    <DockPanel
                                        Grid.Column="2"
                                        Grid.Row="0"
                                        LastChildFill="False"
                                        Visibility="{Binding ShowPrivacy, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                        <FZMaterial
                                            Style="{StaticResource A_Style_FZMaterial_Divider}"
                                            Width="{StaticResource A_Divider_Width}"
                                            DockPanel.Dock="Left" />
                                        <FZTextBlock
                                            Text="{Loc Storefront.IDS_PrivacyTitle}"
                                            Style="{StaticResource A_Style_FZTextBlock_TitleElement}"
                                            DockPanel.Dock="Top"
                                            Margin="0,0,0,8" />
                                        <FZTextBlock
                                            Text="{Binding ShareStatus}"
                                            Style="{StaticResource A_Style_FZTextBlock_InfoElement}"
                                            DockPanel.Dock="Top" />
                                    </DockPanel>
                                    <DockPanel
                                        Grid.Column="0"
                                        Grid.Row="2"
                                        Style="{StaticResource A_Style_DockPanel_DownloadStats}">
                                        <FZTextBlock
                                            Text="{Loc Storefront.IDS_NumberDownloads}"
                                            Style="{StaticResource A_Style_FZTextBlock_TitleElement}"
                                            DockPanel.Dock="Top" />
                                        <Decorator
                                            Height="8"
                                            DockPanel.Dock="Top" />
                                        <FZTextBlock
                                            Text="{Binding DownloadCount}"
                                            Style="{StaticResource A_Style_FZTextBlock_InfoElement}"
                                            DockPanel.Dock="Top" />
                                    </DockPanel>
                                    <DockPanel
                                        Grid.Column="1"
                                        Grid.Row="2"
                                        Style="{StaticResource A_Style_DockPanel_UsageStats}">
                                        <FZMaterial
                                            Style="{StaticResource A_Style_FZMaterial_Divider}"
                                            Width="{StaticResource A_Divider_Width}"
                                            DockPanel.Dock="Left" />
                                        <FZTextBlock
                                            Text="{Loc Storefront.IDS_NumberUses}"
                                            Style="{StaticResource A_Style_FZTextBlock_TitleElement}"
                                            DockPanel.Dock="Top" />
                                        <Decorator
                                            Height="8"
                                            DockPanel.Dock="Top" />
                                        <FZTextBlock
                                            Text="{Binding UseCount}"
                                            Style="{StaticResource A_Style_FZTextBlock_InfoElement}"
                                            DockPanel.Dock="Top" />
                                    </DockPanel>
                                    <DockPanel
                                        Grid.Column="2"
                                        Grid.Row="2"
                                        Style="{StaticResource A_Style_DockPanel_LikeStats}">
                                        <FZMaterial
                                            Style="{StaticResource A_Style_FZMaterial_Divider}"
                                            Width="{StaticResource A_Divider_Width}"
                                            DockPanel.Dock="Left" />
                                        <FZTextBlock
                                            Text="{Loc Storefront.IDS_NumberLikes}"
                                            Style="{StaticResource A_Style_FZTextBlock_TitleElement}"
                                            DockPanel.Dock="Top" />
                                        <Decorator
                                            Height="8"
                                            DockPanel.Dock="Top" />
                                        <FZTextBlock
                                            Text="{Binding LikeCount}"
                                            Style="{StaticResource A_Style_FZTextBlock_InfoElement}"
                                            DockPanel.Dock="Top" />
                                    </DockPanel>
                                </Grid>
                            </StackPanel>
                            <Grid
                                DockPanel.Dock="Top"
                                VerticalAlignment="Top"
                                Margin="0,0,0,0">
                                <Grid
                                    ClipToBounds="True">
                                    <FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/DotPatternA.png"
                                                GetSizeFromTexture="True"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Top"
                                                Visibility="{Binding IsCarThumbnail, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}"/>
                                    <FZMaterial Style="{StaticResource A_Style_FZMaterial_Thumbnail}"
                                                VerticalAlignment="Top" ImageSource="{Binding Thumbnail}" />
                                </Grid>
                                <FZMaterialGlassCapture />
                                <FZMaterial
                                    Style="{StaticResource A_Style_FZMaterial_PopularityBacking}"
                                    VerticalAlignment="Bottom">
                                    <StackPanel
                                        Margin="18">
                                        <FZTextBlock
                                            DockPanel.Dock="Top"
                                            Text="{Binding Filename}"
                                            Style="{StaticResource A_Style_FZTextBlock_FileNameElement}"
                                            HorizontalAlignment="Center" />
                                        <DeltaProgressBar
                                            x:Name="Value_Popularity"
                                            BaseValue="{Binding Popularity}"
                                            NewValue="{Binding Popularity}"
                                            Style="{StaticResource A_Style_DeltaProgressBar_Popularity}"
                                            BindingProxy.A="{StaticResource H_Color_Primary_Grey_70pc}"
                                            BindingProxy.B="{StaticResource H_Color_Primary_Yellow}"
                                            Visibility="{Binding ShowShareStats, Converter={StaticResource A_Converter_BoolToVis}}"
                                            Margin="-4,10,0,0"
                                            HorizontalAlignment="Center" />
                                    </StackPanel>
                                </FZMaterial>
                            </Grid>
                        </DockPanel>
                    </Decorator>
                </ContentControl>
                <CommonListBox
                    x:Name="PART_Menu"
                    DockPanel.Dock="Bottom"
                    Style="{StaticResource A_Style_ListBox_TextMenu_Default}"
                    ItemTemplate="{StaticResource A_DataTemplate_TextMenu_FileOption}"
                    ItemsSource="{Binding Options}" />
            </StackPanel>
        </Grid>
    </Grid>
</Page>