<Page xmlns:local="clr-namespace:ForzaUI"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      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"  
      x:Class="ForzaUI.Scenes.Anthem.A_GarageOptions"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      >

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

    <Page.Resources>
        <ResourceDictionary>
            <Style TargetType="FZTextBlock"
                   x:Key="H_Style_Text_Description_Body">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}" />
                <Setter Property="FontFamily" Value="Horizon_D" />
                <Setter Property="CapHeight" Value="14" />
                <Setter Property="TextWrapping" Value="Wrap" />
                <Setter Property="TextAlignment" Value="Left" />
                <Setter Property="HorizontalAlignment" Value="Left" />
                <Setter Property="VerticalAlignment" Value="Top" />
                <Setter Property="Margin" Value="28,24" />
            </Style>

            <Style TargetType="FZTextBlock"
                   x:Key="H_Style_Text_AdditionalInfo_Title">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Grey_70pc}" />
                <Setter Property="FontFamily" Value="Horizon_C" />
                <Setter Property="CapHeight" Value="17" />
                <Setter Property="TextAlignment" Value="Center" />
            </Style>
            <Style TargetType="FZTextBlock"
                   x:Key="H_Style_Text_AdditionalInfo_Entry">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Yellow}" />
                <Setter Property="FontFamily" Value="Horizon_B" />
                <Setter Property="CapHeight" Value="17" />
                <Setter Property="TextAlignment" Value="Center" />
            </Style>

            <DataTemplate DataType="{x:Type local:GarageCreationButtonItemDataSource}">
                <DataTemplate.Resources>
                    <Style x:Key="A_Style_FZMaterial_Tiled_Notification_Background" TargetType="{x:Type FZMaterial}">
                        <Setter Property="Color" Value="{Binding IsGarageOpenForVisits, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_VisitorPermission_To_Background_Color}}"/>
                    </Style>
                    <Style x:Key="A_Style_FZMaterial_Tiled_Notification_Text" TargetType="{x:Type FZTextBlock}">
                        <Setter Property="Color" Value="{Binding IsGarageOpenForVisits, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_VisitorPermission_To_Text_Color}}"/>
                        <Setter Property="Text" Value="{Binding IsGarageOpenForVisits, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_VisitorPermission_To_String}}"/>
                    </Style>
                    <Double x:Key="A_Double_Badge_Width">95</Double>
                </DataTemplate.Resources>
                <Grid>
                    <local:FZMaterial Style="{StaticResource H_Style_FZMaterial_Button_Icon}"
                          HorizontalAlignment="Right" VerticalAlignment="Center" />
                    <local:FZTextBlock HorizontalAlignment="Left" Style="{StaticResource A_Style_ListBoxItem_Creation_Button_Text}" Text="{Binding Title}" />
                    <ContentControl Style="{StaticResource A_Style_ContentControl_Text_Badge}"
                                    HorizontalAlignment="Right"
                                    VerticalAlignment="Center"
                                    Margin="0,0,18,0"
                                    x:Name="Badge"
                                    Visibility="{Binding IsVisitorPermissionButton, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                </Grid>
            </DataTemplate>
        </ResourceDictionary>
    </Page.Resources>

    <Grid>
        <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="PART_DefaultHelpPanel"
                                local:ControllerButtonPanel.ADescription="{local:Loc HelpButtons.IDS_Select}"
                                local:ControllerButtonPanel.BDescription="{local:Loc HelpButtons.IDS_Cancel}"
                                Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
            </ContentControl>
        </Grid>

        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}"
              Focusable="False">
            <StackPanel x:Name="MainContent"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                <ContentControl Content="{local:Loc ScreenTitles.IDS_GarageOptions}"
                                Style="{StaticResource A_Style_ContentControl_PopupTitleBlock}"
                                HorizontalAlignment="Stretch"
                                Width="Auto"/>
                <DockPanel>
                    <ContentControl x:Name="PART_Flyer"
                                    DataContext="{Binding Poster}"
                                    Style="{StaticResource A_Style_Control_CampaignFlyer}"
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center"
                                    DockPanel.Dock="Left"
                                    Margin="0,0,4,0"/>
                    <DockPanel DockPanel.Dock="Left" Width="{StaticResource A_Double_CreationButton_ListItem_Width}" Margin="0,0,0,-4">
                        <CommonListBox Style="{StaticResource A_Style_Carousel_Creation_ButtonList}"
                                       ItemsSource="{Binding Items, RelativeSource={RelativeSource AncestorType=Page}}"
                                       SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                                       DockPanel.Dock="Bottom" />
                        <ContentControl Style="{StaticResource A_Style_ContentControl_PopupContentBlock}" Panel.ZIndex="-1">
                            <StackPanel>
                                <FZTextBlock Style="{StaticResource H_Style_Text_Description_Body}"
                                             Text="{Binding Description}" />
                                <StackPanel Orientation="Horizontal" 
                                            HorizontalAlignment="Center"
                                            Margin="28,12">
                                    <FZTextBlock Style="{StaticResource H_Style_Text_AdditionalInfo_Title}"
                                                 Text="{local:Loc GarageLayout.IDS_GarageOptions_Published}"
                                                 Visibility="{Binding Visibility, ElementName=PublishedDateText}"/>
                                    <Decorator Width="8" />
                                    <FZTextBlock x:Name="PublishedDateText"
                                                 Style="{StaticResource H_Style_Text_AdditionalInfo_Entry}"
                                                 Text="{Binding PublishedDate}"
                                                 Visibility="{Binding PublishedDate, Converter={StaticResource A_StringVisConverter}}"/>
                                </StackPanel>
                            </StackPanel>
                        </ContentControl>
                    </DockPanel>
                </DockPanel>
            </StackPanel>
        </Grid>
    </Grid>
</Page>
