<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ForzaUI"
    xmlns:System="clr-namespace:System;assembly=mscorlib">

    <Style x:Key="A_Style_FZTextBlock_Keyword" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_Body}" >
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text_Alternate}"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="FontSize" Value="18"/>
        <Setter Property="Margin" Value="12,9,12,9"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_Description" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_Body}" >
        <Setter Property="FontSize" Value="18"/>
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text}"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="FontSize" Value="18"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_ClubStatHeading" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_Heading}" >
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text}"/>
        <Setter Property="FontSize" Value="22"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="Margin" Value="1,0,0,0"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_ClubStats" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_Title_Large}" >
        <Setter Property="FontSize" Value="90"/>
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_BodyText}"/>
        <Setter Property="Margin" Value="-2,5,0,0"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_ClubMemberName" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_Heading}" >
        <Setter Property="FontSize" Value="28"/>
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_BodyText}"/>
        <Setter Property="Margin" Value="0,-6,0,0"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="StretchDirection" Value="DownOnly"/>
        <Setter Property="TextWrapping" Value="NoWrap"/>
    </Style>

    <Style BasedOn="{StaticResource A_Style_FZTextBlock_Heading_Large}"
           TargetType="local:FZTextBlock"
           x:Key="A_Style_FZTextBlock_TileClubLevelTitle">
        <Setter Property="Color"
                Value="{StaticResource A_Color_Tile_Text_Alternate}" />
        <Setter Property="FontSize"
                Value="44" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="Margin"
                Value="0,0,0,110" />
    </Style>

    <Style BasedOn="{StaticResource A_Style_FZTextBlock_TileClubLevelTitle}"
           TargetType="local:FZTextBlock"
           x:Key="A_Style_FZTextBlock_TileClubLevel">
        <Setter Property="FontSize" Value="74" />
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_Selected}" />
        <Setter Property="Margin" Value="0,53,0,0" />
        <Setter Property="VerticalAlignment" Value="Top" />
    </Style>

    <Color x:Key="A_Color_ClubTile_Subtitle">#FFAAAAAA</Color>

    <Style x:Key="A_Style_FZTextBlock_TileClubTagHuge"
           TargetType="{x:Type local:FZTextBlock}"
           BasedOn="{StaticResource A_Style_FZTextBlock_Heading}">
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_Selected}"/>
        <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="StretchDirection" Value="DownOnly" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="FontSize" Value="80" />
        <Setter Property="Margin" Value="-3,7,0,7" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TileClubName"
           TargetType="{x:Type local:FZTextBlock}"
           BasedOn="{StaticResource A_Style_FZTextBlock_Title_Large}">
        <Setter Property="Color"
                Value="{StaticResource A_Color_Tile_BodyText}" />
        <Setter Property="TextWrapping"
                Value="WrapWithOverflow" />
        <Setter Property="Stretch"
                Value="None" />
        <Setter Property="StretchDirection"
                Value="DownOnly" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="FontSize"
                Value="44" />
        <Setter Property="Margin"
                Value="0,4,0,4" />
    </Style>

    <Style x:Key="A_Style_FZRun_ClubInfoPanel_NAME"
           TargetType="local:FZRun">
        <Setter Property="Color"
                Value="{StaticResource A_Color_Tile_Text}" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_ClubLeaderboardRow" TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" >
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="StretchDirection" Value="DownOnly" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_ClubLeaderboardRow_Rank"
           TargetType="{x:Type local:FZTextBlock}"
           BasedOn="{StaticResource A_Style_FZTextBlock_ClubLeaderboardRow}">
        <Setter Property="FontSize" Value="{StaticResource A_FontSize_Cell}" />
    </Style>

    <Style TargetType="{x:Type local:FZMaterial}"
           BasedOn="{StaticResource A_Style_FZMaterial_GlossyBlack}"
           x:Key="A_Style_FZMaterial_ClubBadge">
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Top" />
        <Setter Property="Width"
                Value="131" />
        <Setter Property="Height"
                Value="169" />
        <Setter Property="ImageSourceNoPreload"
                Value="/ForzaUI;component/Textures/Anthem/Icons/PauseMenu/ClubLevelIcon.png" />
    </Style>

    <Style x:Key="A_Style_FZMaterial_ClubLeaderboardRow_Rank_Image"
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Width" Value="46"/>
        <Setter Property="Height" Value="44"/>
        <Setter Property="Color" Value="{StaticResource A_Color_DriverListRowText}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                <Setter Property="Color" Value="{StaticResource A_Color_LocalPlayer_Text}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <ImageSource x:Key="A_ImageSource_PrivacyStatusIcon">/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/Privacy_Status_Icon.png</ImageSource>
    <ImageSource x:Key="A_ImageSource_ClubLeaderIcon">/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/Club_Leader_Icon.png</ImageSource>
    <ImageSource x:Key="A_ImageSource_ClubChampionIcon">/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/Ladder_Champion_Icon.png</ImageSource>
    <ImageSource x:Key="A_ImageSource_ClubLeaderLeaderboardIcon">/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/Club_Leader_LeaderboardIcon.png</ImageSource>
    <ImageSource x:Key="A_ImageSource_ClubCoLeaderLeaderboardIcon">/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/Co_Leader_LeaderboardIcon.png</ImageSource>
    <ImageSource x:Key="A_ImageSource_ClubChampionLeaderboardIcon">/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/Ladder_Champion_LeaderboardIcon.png</ImageSource>

    <Style x:Key="A_FZMaterial_ClubIcon"
           TargetType="{x:Type local:FZMaterial}"
           BasedOn="{StaticResource A_Style_FZMaterial_GlossyBlack}">
        <Setter Property="Width" Value="46" />
        <Setter Property="Height" Value="44" />
        <Setter Property="Margin" Value="0,0,5,0" />
    </Style>

    <Style x:Key="A_Style_DockPanel_ClubIcon"
           TargetType="{x:Type DockPanel}">
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Height" Value="57"/>
    </Style>

    <Style x:Key="A_Style_Control_Keyword" TargetType="{x:Type Control}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GlossyBlack}"
                                      Color="{StaticResource A_Color_Tile_BodyText}"
                                      Margin="0,0,10,0">
                        <local:FZTextBlock Text="{TemplateBinding Tag}"
                                           Style="{StaticResource A_Style_FZTextBlock_Keyword}"/>
                    </local:FZMaterial>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate TargetType="Control"
                     x:Key="A_ControlTemplate_ClubInfoPanel">
        <DockPanel Visibility="{Binding ClubTag, Converter={StaticResource A_StringVisConverter}}"
                   Height="169">
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_ClubBadge}"
                              DockPanel.Dock="Left"
                              Margin="0,0,23,0">
                <Grid>
                    <local:FZTextBlock Text="{local:Loc Clan.IDS_LVL}"
                                   Style="{StaticResource A_Style_FZTextBlock_TileClubLevelTitle}"/>
                    <local:FZTextBlock Text="{Binding ClubLevel, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}"
                                   Style="{StaticResource A_Style_FZTextBlock_TileClubLevel}"/>
                </Grid>
            </local:FZMaterial>
            <DockPanel>
                <Viewbox HorizontalAlignment="Left"
                         VerticalAlignment="Bottom"
                         StretchDirection="DownOnly"
                         Stretch="Uniform"
                         Margin="1,0,1,0"
                         Visibility="{Binding IsLoading, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}" DockPanel.Dock="Bottom">
                    <StackPanel Orientation="Horizontal">
                        <Control Tag="{Binding RegionKeyword}"
                                 Style="{StaticResource A_Style_Control_Keyword}"/>
                        <Control Tag="{Binding AttitudeKeyword}"
                                 Style="{StaticResource A_Style_Control_Keyword}"/>
                        <Control Tag="{Binding InterestKeyword}"
                                 Style="{StaticResource A_Style_Control_Keyword}"/>
                    </StackPanel>
                </Viewbox>
                <DockPanel>
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TileClubTagHuge}"
                                       Text="{Binding ClubTag}"
                                       Stretch="Uniform"
                                       StretchDirection="DownOnly"
                                       DockPanel.Dock="Top"/>
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TileClubName}"
                                       local:TextBlockInlineMarkup.Markup="{Binding ClubNameAndMemberCount}"
                                       local:TextBlockInlineMarkup.ResourceBaseName="A_Style_FZRun_ClubInfoPanel_"
                                       Stretch="Uniform"
                                       StretchDirection="DownOnly"
                                       TextWrapping="NoWrap"/>
                </DockPanel>
            </DockPanel>
        </DockPanel>
    </ControlTemplate>

    <!-- Main Club Detail template - reference this to display club detail. -->
    <ControlTemplate x:Key="A_Template_ContentControl_ClubDetail">
        <StackPanel>
            <!-- Club Info Panel -->
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}"
                              Margin="0,0,0,5"
                              Height="240">
                <Grid Margin="28,0,28,0">
                    <ProgressBar IsIndeterminate="True"
                                                 Style="{StaticResource A_Style_ProgressBar_WaitSpinnerDark}" 
                                                 HorizontalAlignment="Center" 
                                                 VerticalAlignment="Center" 
                                                 Visibility="{Binding IsLoading, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>

                    <ContentControl Template="{StaticResource A_ControlTemplate_ClubInfoPanel}"
                                    Visibility="{Binding IsLoading, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"
                                    VerticalAlignment="Center"/>
                </Grid>
            </local:FZMaterial>

            <!-- Club Members Info Panel -->
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}"
                              Margin="0,0,0,5"
                              Height="260">
                <Grid Margin="28,22,28,22"
                      Visibility="{Binding IsLoading, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Width="266" Margin="0,0,10,0" Grid.Column="0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0">
                            <local:FZTextBlock Text="{local:Loc Clan.IDS_Member_Count}"
                                                           Style="{StaticResource A_Style_FZTextBlock_ClubStatHeading}"/>
                            <local:FZTextBlock Text="{Binding MemberCount}"
                                                           Style="{StaticResource A_Style_FZTextBlock_ClubStats}"/>
                        </StackPanel>
                        <StackPanel Grid.Row="1" Margin="0,9,0,0">
                            <local:FZTextBlock Text="{local:Loc Clan.IDS_Leaderboard_Position}"
                                                           Style="{StaticResource A_Style_FZTextBlock_ClubStatHeading}"/>
                            <local:FZTextBlock Text="{Binding LeaderboardPosition}"
                                                           Style="{StaticResource A_Style_FZTextBlock_ClubStats}"/>
                        </StackPanel>
                    </Grid>

                    <Grid Grid.Column="1">
                        <!-- Club Leader -->
                        <DockPanel Style="{StaticResource A_Style_DockPanel_ClubIcon}">
                            <local:FZMaterial ImageSource="{StaticResource A_ImageSource_ClubLeaderIcon}"
                                              Style="{StaticResource A_FZMaterial_ClubIcon}"
                                              DockPanel.Dock="Left"/>
                            <StackPanel>
                                <local:FZTextBlock Text="{local:Loc Clan.IDS_Club_Leader_Name}"
                                                   Style="{StaticResource A_Style_FZTextBlock_ClubStatHeading}"/>
                                <local:FZTextBlock Text="{Binding ClubLeaderUserProfile.FormattedGamertag}"
                                                   Style="{StaticResource A_Style_FZTextBlock_ClubMemberName}"/>
                            </StackPanel>
                        </DockPanel>

                        <!-- Ladder Champion -->
                        <DockPanel Style="{StaticResource A_Style_DockPanel_ClubIcon}"
                                   Margin="0,82,0,0">
                            <local:FZMaterial ImageSource="{StaticResource A_ImageSource_ClubChampionIcon}"
                                                              Style="{StaticResource A_FZMaterial_ClubIcon}"
                                                              DockPanel.Dock="Left"/>
                            <StackPanel>
                                <local:FZTextBlock Text="{local:Loc Clan.IDS_League_Champion}"
                                                           Style="{StaticResource A_Style_FZTextBlock_ClubStatHeading}"/>
                                <local:FZTextBlock Text="{Binding LeagueChampionUserProfile.FormattedGamertag}"
                                                           Style="{StaticResource A_Style_FZTextBlock_ClubMemberName}"/>
                            </StackPanel>
                        </DockPanel>

                        <!-- Privacy Status -->
                        <DockPanel Style="{StaticResource A_Style_DockPanel_ClubIcon}" 
                                   Margin="0,162,0,0">
                            <local:FZMaterial ImageSource="{StaticResource A_ImageSource_PrivacyStatusIcon}"
                                              Style="{StaticResource A_FZMaterial_ClubIcon}"
                                              DockPanel.Dock="Left"/>
                            <StackPanel>
                                <local:FZTextBlock Text="{local:Loc Clan.IDS_Privacy_Status}"
                                                   Style="{StaticResource A_Style_FZTextBlock_ClubStatHeading}"/>
                                <local:FZTextBlock Text="{Binding PrivacyStatus}"
                                                   Style="{StaticResource A_Style_FZTextBlock_ClubMemberName}"/>
                            </StackPanel>
                        </DockPanel>
                    </Grid>
                </Grid>
            </local:FZMaterial>

            <!-- Club Description Panel -->
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}"
                              Height="205">
                <Grid Margin="27,18,27,18"
                      Visibility="{Binding IsLoading, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                    <local:FZTextBlock Text="{Binding ClubDescription}"
                                       Style="{StaticResource A_Style_FZTextBlock_Description}"
                                       Stretch="Uniform"
                                       Visibility="{Binding ClubDescription, Converter={StaticResource A_StringVisConverter}}"/>
                    <local:FZTextBlock Text="{local:Loc Clan.IDS_NoDescription}"
                                       Style="{StaticResource A_Style_FZTextBlock_Description}"
                                       Stretch="Uniform"
                                       Visibility="{Binding ClubDescription, Converter={StaticResource A_StringVisConverter_Inverse}}"/>
                </Grid>
            </local:FZMaterial>
        </StackPanel>
    </ControlTemplate>
</ResourceDictionary>