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

    <Page.Resources>

        <DropShadowEffect x:Key="A_DropShadowSynthesized" BlurRadius="0" ShadowDepth="2.5" Color="#3C000000" />
        
        <local:MappingConverter x:Key="A_MappingConverter_Bool_IsOveride_From_OverrideId" Default="{StaticResource A_Boolean_False}">
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_MappingConverter_ToplineTemplate_From_OverrideId" Default="{x:Null}">
        </local:MappingConverter>

        <local:MultiConverter x:Key="A_Converter_Hide_If_Overridden" ConvertNullValues="True">
            <local:MultiConverterEntry Converter="{StaticResource A_MappingConverter_Bool_IsOveride_From_OverrideId}" />
            <local:MultiConverterEntry Converter="{StaticResource A_FZBooleanToVisibilityConverter_Inverse}" />
        </local:MultiConverter>

        <Style TargetType="{x:Type local:FZRun}" x:Key="A_Style_FZRun_EventInfo_HIGHLIGHT">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_Green}"/>
        </Style>

        <Style TargetType="{x:Type local:FZRun}" x:Key="A_Style_FZRun_EventInfo_WHITE">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
        </Style>

        <MappingConverter x:Key="A_MappingConverter_EventInfo">
            <MappingConverterEntry Key="{NoCase HIGHLIGHT}" Value="{StaticResource A_Style_FZRun_EventInfo_HIGHLIGHT}" />
            <MappingConverterEntry Key="{NoCase WHITE}" Value="{StaticResource A_Style_FZRun_EventInfo_WHITE}" />
        </MappingConverter>

        <Duration x:Key="A_Duration_Show">0:0:0.5</Duration>
        <Duration x:Key="A_Duration_Hide">0:0:0.5</Duration>

        <Duration x:Key="A_Delay_Show">0:0:1.0</Duration>
        <Duration x:Key="A_Delay_Hide">0:0:1.0</Duration>

        <Duration x:Key="A_Spread_Show">0:0:0.5</Duration>
        <Duration x:Key="A_Spread_Hide">0:0:0.0</Duration>

        <Style x:Key="A_Style_FrameworkElement_CustomTransition"
               TargetType="{x:Type FrameworkElement}">
            <Style.Resources>
                <local:UIStoryboard x:Key="PART_transition_in">
                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="{x:Null}"
                                     Duration="{StaticResource A_Duration_Show}"
                                     From="0" To="1"/>
                    <DoubleAnimation Storyboard.TargetProperty="(FrameworkElement.RenderTransform).(TranslateTransform.X)"
                                     Storyboard.TargetName="{x:Null}"
                                     Duration="{StaticResource A_Duration_Show}"
                                     From="-10" To="0"
                                     EasingFunction="{local:QuarticEasing EasingMode=EaseOut}"/>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="TextShadow"
                                     Duration="{StaticResource A_Duration_Show}"
                                     From="0" To="1" />
                </local:UIStoryboard>

                <local:UIStoryboard x:Key="transition_out">
                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="{x:Null}"
                                     Duration="{StaticResource A_Duration_Hide}"
                                     From="1" To="0"/>
                    <DoubleAnimation Storyboard.TargetProperty="(FrameworkElement.RenderTransform).(TranslateTransform.X)"
                                     Storyboard.TargetName="{x:Null}"
                                     Duration="{StaticResource A_Duration_Hide}"
                                     From="0" To="10"
                                     EasingFunction="{local:QuarticEasing EasingMode=EaseIn}"/>
                    <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                     Storyboard.TargetName="TextShadow"
                                     Duration="{StaticResource A_Duration_Hide}"
                                     From="1" To="0" />
                </local:UIStoryboard>
            </Style.Resources>
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <TranslateTransform />
                </Setter.Value>
            </Setter>
            <Setter Property="Opacity" Value="0"/>
            <Setter Property="local:UIPageTransitionManager.TransitionIndex"
                    Value="0" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_LineBase"
               TargetType="{x:Type local:FZTextBlock}">
            <Setter Property="FontFamily" Value="Horizon_C"/>
            <Setter Property="LineAdjust" Value="0"/>
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="TextAlignment" Value="Left" />
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
            <Setter Property="Effect" Value="{StaticResource A_DropShadowSynthesized}"/>
        </Style>

        <Style x:Key="A_Style_FZTextBlock_Line1"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_LineBase}">
            <Setter Property="CapHeight" Value="20"/>
            <Setter Property="TrackingAdjust" Value="-0.001"/>
            <Setter Property="Visibility" Value="{Binding TopLineOverrideId, Converter={StaticResource A_Converter_Hide_If_Overridden}, FallbackValue=Visible}"/>
        </Style>

        <Style x:Key="A_Style_FZTextBlock_Line2"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_LineBase}">
            <Setter Property="CapHeight" Value="55"/>
            <Setter Property="TrackingAdjust" Value="0.01"/>
        </Style>

        <Style x:Key="A_Style_Control_Override_TopLine" TargetType="Control">
            <Setter Property="Visibility" Value="Collapsed"/>
            <Setter Property="Template" Value="{x:Null}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding TopLineOverrideId, Converter={StaticResource A_MappingConverter_Bool_IsOveride_From_OverrideId}}" Value="{StaticResource A_Boolean_True}">
                    <Setter Property="Visibility" Value="Visible"/>
                    <Setter Property="Template" Value="{Binding TopLineOverrideId, Converter={StaticResource A_MappingConverter_ToplineTemplate_From_OverrideId}}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Page.Resources>

    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager>
            <local:UIPageTransitionManager.Preset>
                <local:UIPageTransitionManagerPreset>
                    <local:UIPageTransitionManagerPreset.TransitionInForwards>
                        <local:UIPageTransition TransitionName="PART_transition_in"
                                                DurationSpread="{StaticResource A_Spread_Show}"
                                                TransitionDelay="{StaticResource A_Delay_Show}" />
                    </local:UIPageTransitionManagerPreset.TransitionInForwards>
                    <local:UIPageTransitionManagerPreset.TransitionOutForwards>
                        <local:UIPageTransition TransitionName="transition_out"
                                                DurationSpread="{StaticResource A_Spread_Hide}"
                                                TransitionDelay="{StaticResource A_Delay_Hide}" />
                    </local:UIPageTransitionManagerPreset.TransitionOutForwards>
                </local:UIPageTransitionManagerPreset>
            </local:UIPageTransitionManager.Preset>
        </local:UIPageTransitionManager>
    </local:UIPageTransitionManager.TransitionManager>

    <Grid x:Name="PART_LayoutRoot">
        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <Grid x:Name="TextContainer"
                    VerticalAlignment="Top"
                    Margin="66,165,0,0"
                    RenderTransformOrigin="0.5,0.5">
                <StackPanel>
                    <Decorator Style="{StaticResource A_Style_FrameworkElement_CustomTransition}"
                               local:UIPageTransitionManager.TransitionIndex="0">
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Line1}"
                                            Color="{StaticResource H_Color_Primary_Green}"
                                            MarkupConverter="{StaticResource A_MappingConverter_EventInfo}"
                                            Text="{Binding TopText}" />
                    </Decorator>
                    <Control Style="{StaticResource A_Style_Control_Override_TopLine}" />
                    <Decorator Height="22" />
                    <Decorator Style="{StaticResource A_Style_FrameworkElement_CustomTransition}"
                               local:UIPageTransitionManager.TransitionIndex="1">
                        <local:FZTextBlock Text="{Binding BottomText}"
                                           Style="{StaticResource A_Style_FZTextBlock_Line2}"/>
                    </Decorator>
                    <Decorator Style="{StaticResource A_Style_FrameworkElement_CustomTransition}"
                               local:UIPageTransitionManager.TransitionIndex="2"
                               Visibility="{Binding ShowExtraBottomText, Converter={FZBooleanToVisibilityConverter}}"
                               Margin="0,16,0,0">
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Line1}"
                                           Color="{StaticResource H_Color_Primary_Green}"
                                           MarkupConverter="{StaticResource A_MappingConverter_EventInfo}"
                                           Text="{Binding ExtraBottomText}" />
                    </Decorator>
                    <local:FZMaterialGlassCapture/>
                    <Decorator Style="{StaticResource A_Style_FrameworkElement_CustomTransition}"
                               local:UIPageTransitionManager.TransitionIndex="0">
                        <local:FZMaterial x:Name="TextShadow" Opacity="0"/>
                    </Decorator>
                </StackPanel>
            </Grid>
        </Grid>

        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="PART_DefaultHelpPanel"
                            Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>
    </Grid>
</Page>
