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

    <Style x:Key="A_Style_FZMaterial_PopupBacking"
           TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_GlassPanel_BodyPanel}">
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="Margin"
                Value="-10,0,-10,10" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_PopupText"
           TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_Body_Tight}">
        <Setter Property="TextWrapping"
                Value="Wrap" />
        <Setter Property="Color"
                Value="{StaticResource A_Color_Body_Text}" />
        <Setter Property="Margin"
                Value="20" />
        <Setter Property="Width"
                Value="{StaticResource A_Double_PopupTextWidth}" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="TextAlignment"
                Value="Center" />
        <Setter Property="FontSize"
                Value="22" />
    </Style>

    <Style x:Key="A_Style_Decorator_MessageBox_Separator" TargetType="Decorator">
        <Setter Property="Visibility" Value="Collapsed"/>
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding HasOptions, FallbackValue=False}" Value="True"/>
                    <Condition Binding="{Binding HasMessage}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility"
                        Value="Visible" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_Popup_TitleBlock"
           BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_HeaderPanel}"
           TargetType="local:FZMaterial">
        <Setter Property="Color"
                Value="{StaticResource A_Color_Popup_TitleBar_Background}" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_Popup_Title"
           TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_Title}">
        <Setter Property="Color"
                Value="{StaticResource A_Color_MessageBox_TitleBar_Text}" />
        <Setter Property="FontSize"
                Value="48" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="Margin"
                Value="24,30" />
    </Style>

    <System:Double x:Key="A_Double_Popup_Title_Height">90</System:Double>
    <System:Double x:Key="A_Double_MessageBox_Width">600</System:Double>
    <System:Double x:Key="A_Double_SettingsBox_Width">672</System:Double>

    <Style x:Key="A_Style_ContentControl_PopupTitleBlock"
           TargetType="ContentControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Popup_TitleBlock}"
                                      Height="{StaticResource A_Double_Popup_Title_Height}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TitleShadow}">
                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Popup_Title}"
                                           Text="{TemplateBinding Content, Converter={StaticResource A_StringToUpper}}"
                                           local:ScreenReader.Line="{TemplateBinding Content}"
                                           local:ScreenReader.Event="OnLoad"
                                           local:ScreenReader.LineType="ScreenTitle" />
                        </local:FZMaterial>
                    </local:FZMaterial>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Content"
                     Value="{x:Null}">
                <Setter Property="Visibility"
                        Value="Collapsed" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <System:Double x:Key="A_Double_Popup_IconWidth">380</System:Double>
    <System:Double x:Key="A_Double_Popup_IconHeight">284</System:Double>

    <local:LinearTransformConverter x:Key="A_Converter_HiResTextureDimensions"
                                    Scale="0.5" />

    <ImageSource x:Key="A_BitmapImage_DefaultPopupIcon">/ForzaUI;component/Textures/Anthem/Icons/Titles/PopupMessageBox.png</ImageSource>

    <Style x:Key="A_Style_ContentControl_PopupContentBlock"
          TargetType="ContentControl">
        <Style.Resources>
            <System:Int32 x:Key="A_Int32_Icon_ZIndex">1</System:Int32>
        </Style.Resources>
        <Setter Property="Tag"
                Value="{StaticResource A_BitmapImage_DefaultPopupIcon}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GlassPanel_PopupPanel}">
                        <Grid>
                            <local:FZMaterial VerticalAlignment="Top"
                                              HorizontalAlignment="Left"
                                              Margin="0,-42,0,0"
                                              Height="{Binding Source={StaticResource A_Double_Popup_IconHeight}, Converter={StaticResource A_Converter_HiResTextureDimensions}}"
                                              Width="{Binding Source={StaticResource A_Double_Popup_IconWidth}, Converter={StaticResource A_Converter_HiResTextureDimensions}}"
                                              ImageSource="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"
                                              x:Name="Icon" />

                            <ContentPresenter Margin="24,36,24,24" Panel.ZIndex="{DynamicResource A_Int32_Icon_ZIndex}"/>
                        </Grid>
                    </local:FZMaterial>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Content"
                                 Value="{x:Null}">
                            <Setter Property="Visibility"
                                    Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_ContentControl_PopupContentBlock_IconFront"
           BasedOn="{StaticResource A_Style_ContentControl_PopupContentBlock}"
          TargetType="ContentControl">
        <Style.Resources>
            <System:Int32 x:Key="A_Int32_Icon_ZIndex">-1</System:Int32>
        </Style.Resources>
    </Style>

    <!-- Common List ControlTemplate that exists for the scroll bar to be external from the popup. See screens using A_CarFilter, A_FollowedPlayers-->
    
    <!-- 36+24, the top and bottom margins of the popup content -->
    <local:LinearTransformConverter x:Key="A_Converter_FilterPopupScrollbarSize"
                                    Add="60" />
    <!-- We need the scrollbar to sit outside the popup content box in the filter popup -->
    <ControlTemplate x:Key="A_ControlTemplate_ScrollViewer_Popup_ExternalRightPosition"
                     TargetType="ScrollViewer">
        <Grid>
            <!-- Canvas ensures the scrollbar doesn't contribute to measure -->
            <Canvas HorizontalAlignment="Right">
                <ScrollBar x:Name="PART_VerticalScrollBar"
                           HorizontalAlignment="Left"
                           Minimum="0"
                           Margin="11,-36,0,-24"
                           MinHeight="{Binding ActualHeight, ElementName=PART_ScrollContentPresenter, Converter={StaticResource A_Converter_FilterPopupScrollbarSize}}"
                           Maximum="{TemplateBinding ScrollViewer.ScrollableHeight}"
                           ViewportSize="{TemplateBinding ScrollViewer.ViewportHeight}"
                           Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                           Visibility="{TemplateBinding ScrollViewer.ComputedVerticalScrollBarVisibility}"
                           Style="{StaticResource A_Style_ScrollBar_TextMenu}" />
            </Canvas>

            <ScrollContentPresenter x:Name="PART_ScrollContentPresenter"
                                    Content="{TemplateBinding Content}"
                                    CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
                                    ClipToBounds="True" />
        </Grid>
    </ControlTemplate>
</ResourceDictionary>