<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">

    <System:Double x:Key="A_Double_MultiItemLiveTileBackground_TotalWidth_Neg">-6</System:Double>
    <System:Double x:Key="A_Double_MultiItemLiveTileBackground_TotalHeight_Neg">-42</System:Double>

    <local:LinearTransformConverter x:Key="A_Converter_MultiItemLiveTile_ItemWidth"
                                    Add="{StaticResource A_Double_MultiItemLiveTileBackground_TotalWidth_Neg}" />
    <local:LinearTransformConverter x:Key="A_Converter_MultiItemLiveTile_ItemHeight"
                                    Add="{StaticResource A_Double_MultiItemLiveTileBackground_TotalHeight_Neg}" />

    <Style x:Key="A_Style_FrameworkElement_LiveTileItemRoot"
        TargetType="{x:Type FrameworkElement}">
        <Setter Property="Width" Value="{Binding Width, RelativeSource={RelativeSource AncestorType=Button}, Converter={StaticResource A_Converter_MultiItemLiveTile_ItemWidth}}"/>
        <Setter Property="Height" Value="{Binding Height, RelativeSource={RelativeSource AncestorType=Button}, Converter={StaticResource A_Converter_MultiItemLiveTile_ItemHeight}}"/>
    </Style>

    <Storyboard x:Key="A_Storyboard_MultiItemLiveTile_SmoothScroll" >
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:BlendValue.Blend)"
                                       Storyboard.TargetName="{x:Null}"
                                       FillBehavior="Stop">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                    Value="0" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.333"
                                  Value="1"
                                  EasingFunction="{local:QuarticEasing EasingMode=EaseInOut}" />
        </DoubleAnimationUsingKeyFrames>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(local:BindingProxy.C)"
                                       Storyboard.TargetName="{x:Null}"
                                       FillBehavior="Stop">
            <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                    Value=""/>
            <DiscreteObjectKeyFrame KeyTime="0:0:0.333"
                                    Value=""/>
        </ObjectAnimationUsingKeyFrames>
    </Storyboard>

    <Style x:Key="A_Style_ItemsSelector_ItemDisplay" TargetType="local:ItemsSelector">
        <Setter Property="FocusVisualStyle" Value="{StaticResource A_Style_BlankVisualStyle}" />
        <Setter Property="ClipToBounds" Value="True" />
        <Setter Property="MultiDataConversion.Value" Value="{Binding (Selector.SelectedIndex), RelativeSource={RelativeSource Self}}"/>
        <Setter Property="MultiDataConversion.Converter" Value="{MathOperationConverter Operation=Multiply}"/>
        <Setter Property="MultiDataConversion.TargetType" Value="{Type Double}"/>
        <Setter Property="MultiDataConversion.Parameter">
            <Setter.Value>
                <Binding
                    Path="ActualWidth"
                    RelativeSource="{RelativeSource Self}"
                    Converter="{MathOperationConverter Operation=Multiply}">
                    <Binding.ConverterParameter>
                        <Double>-1</Double>
                    </Binding.ConverterParameter>
                </Binding>
            </Setter.Value>
        </Setter>
        <Setter Property="local:BlendValue.Input" Value="{Binding (MultiDataConversion.Output), RelativeSource={RelativeSource Self}}"/>
        <Setter Property="local:BlendValue.InputChangedStoryboard" Value="{StaticResource A_Storyboard_MultiItemLiveTile_SmoothScroll}"/>
        <Setter Property="local:BindingProxy.C" Value="DisableMotionBlur"/>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="{Type ContentControl}">
                    <Setter Property="Width" Value="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=ItemsSelector}}" />
                    <Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=ItemsSelector}}" />
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    <Setter Property="VerticalContentAlignment" Value="Stretch" />
                    <Setter Property="TileMenuNavigationManager.TextColorScheme" Value="{Binding (TileMenuNavigationManager.TextColorScheme), RelativeSource={RelativeSource AncestorType=ContentControl}}" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_MotionBlurExpander}" />
                        <StackPanel
                            x:Name="ItemsHost"
                            Style="{StaticResource A_Style_MotionBlur}"
                            Orientation="Horizontal"
                            IsItemsHost="True"
                            HorizontalAlignment="Left">
                            <UIElement.RenderTransform>
                                <TranslateTransform X="{Binding (BlendValue.Output), RelativeSource={RelativeSource TemplatedParent}}" />
                            </UIElement.RenderTransform>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <EventTrigger RoutedEvent="NextSel">
                <local:StartAudioTrigger EventName="AudioUITrigger_PauseImageRoll"/>
            </EventTrigger>
            <EventTrigger RoutedEvent="PrevSel">
                <local:StartAudioTrigger EventName="AudioUITrigger_PauseImageRoll"/>
            </EventTrigger>
        </Style.Triggers>
    </Style>

    <CornerRadius x:Key="A_Preset_CornerRadius_Divider">2,2,2,2</CornerRadius>

    <FZMaterialPresetRoundtangleStroke
        x:Key="A_RoundtangleStroke_Paginations_Outline"
        Thickness="2"
        CornerRadius="{Binding ActualHeight, Converter={MathOperationConverter Operation=Divide}, 
                        ConverterParameter={StaticResource A_Preset_CornerRadius_Divider}, 
                        RelativeSource={RelativeSource AncestorType=FZMaterial}}"/>
    <FZMaterialPresetRoundtangle 
        x:Key="A_Roundtangle_Paginations_InnerFilling"
        CornerRadius="{Binding ActualHeight, Converter={MathOperationConverter Operation=Divide}, 
                        ConverterParameter={StaticResource A_Preset_CornerRadius_Divider}, 
                        RelativeSource={RelativeSource AncestorType=FZMaterial}}"/>

    <Style x:Key="A_Style_Tile_SelectionDots_Base" TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
        <Setter Property="Preset" Value="{StaticResource A_Roundtangle_Paginations_InnerFilling}"/>
    </Style>
    <Style x:Key="A_Style_Tile_SelectionDots_Selected_Base" TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
        <Setter Property="Preset" Value="{StaticResource A_Roundtangle_Paginations_InnerFilling}"/>
    </Style>
    <Style x:Key="A_Style_Tile_SelectionDots_Base_Outline" TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
        <Setter Property="Preset" Value="{StaticResource A_RoundtangleStroke_Paginations_Outline}"/>
    </Style>
    <Style x:Key="A_Style_Tile_SelectionDots_Selected_Base_Outline" TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Green}"/>
        <Setter Property="Preset" Value="{StaticResource A_RoundtangleStroke_Paginations_Outline}"/>
    </Style>

    <Style x:Key="A_Style_ItemsSelector_SelectionDots" TargetType="ItemsSelector">
        <Style.Resources>
            <System:Double x:Key="A_Double_SelectionDot_Width">20</System:Double>
            <System:Double x:Key="A_Double_SelectionDot_Height">20</System:Double>
            <Thickness x:Key="A_Thickness_SelectionDot_Margin">4,0</Thickness>
            <Style x:Key="A_Style_Tile_SelectionDots_Dynamic" TargetType="{x:Type FZMaterial}" BasedOn="{StaticResource A_Style_Tile_SelectionDots_Base}" />
            <Style x:Key="A_Style_Tile_SelectionDots_Selected_Dynamic" TargetType="{x:Type FZMaterial}" BasedOn="{StaticResource A_Style_Tile_SelectionDots_Selected_Base}" />
            <Style x:Key="A_Style_Tile_SelectionDots_Dynamic_Outline" TargetType="{x:Type FZMaterial}" BasedOn="{StaticResource A_Style_Tile_SelectionDots_Base_Outline}" />
            <Style x:Key="A_Style_Tile_SelectionDots_Selected_Dynamic_Outline" TargetType="{x:Type FZMaterial}" BasedOn="{StaticResource A_Style_Tile_SelectionDots_Selected_Base_Outline}" />
        </Style.Resources>
        <Setter Property="FocusVisualStyle" Value="{Null}" />
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="ContentControl">
                    <Setter Property="Width" Value="{DynamicResource A_Double_SelectionDot_Width}" />
                    <Setter Property="Height" Value="{DynamicResource A_Double_SelectionDot_Height}" />
                    <Setter Property="Margin" Value="{DynamicResource A_Thickness_SelectionDot_Margin}" />
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    <Setter Property="VerticalContentAlignment" Value="Stretch" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <FZMaterial x:Name="InnerFilling"
                                Style="{DynamicResource A_Style_Tile_SelectionDots_Dynamic}">
                        <FZMaterial x:Name="OutlineStroke" 
                                    Style="{DynamicResource A_Style_Tile_SelectionDots_Dynamic_Outline}"/>
                    </FZMaterial>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=(Selector.IsSelected), RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}" Value="True">
                            <Setter Property="Style" TargetName="OutlineStroke" Value="{DynamicResource A_Style_Tile_SelectionDots_Selected_Dynamic_Outline}"/>
                            <Setter Property="Style" TargetName="InnerFilling" Value="{DynamicResource A_Style_Tile_SelectionDots_Selected_Dynamic}"/>
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <StackPanel
                        IsItemsHost="true"
                        Orientation="Horizontal"
                        Tag="{DynamicResource A_Thickness_SelectionDot_Margin}">
                        <StackPanel.Margin>
                            <Binding
                                Path="Tag"
                                RelativeSource="{RelativeSource Self}"
                                Converter="{MathOperationConverter Operation=Multiply}">
                                <Binding.ConverterParameter>
                                    <Thickness>-1</Thickness>
                                </Binding.ConverterParameter>
                            </Binding>
                        </StackPanel.Margin>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_FeaturedText" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
        <Setter Property="FontSize" Value="60"/>
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text_Alternate}"/>
        <Setter Property="TextAlignment" Value="Right" />
        <Setter Property="TextWrapping" Value="NoWrap" />
    </Style>
</ResourceDictionary>
