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

    <Thickness x:Key="A_Thickness_MultiItemLiveTileBackground">3,3,3,42</Thickness>
    <System:Double x:Key="A_Double_MultiItemLiveTileBackground_TotalWidth">6</System:Double>
    <System:Double x:Key="A_Double_MultiItemLiveTileBackground_TotalWidth_Neg">-6</System:Double>
    <System:Double x:Key="A_Double_MultiItemLiveTileBackground_TotalHeight_Neg">-42</System:Double>
    <Thickness x:Key="A_Thickness_MultiItemLiveTileBackground_WithOffset">3.5,3.5,3.5,42.5</Thickness>

    <local:LinearTransformConverter x:Key="A_Converter_MultiItemLiveTile_ItemWidth_Neg"
                                    Add="{StaticResource A_Double_MultiItemLiveTileBackground_TotalWidth}"
                                    Scale="-1" />
    <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}" />

    <local:LinearTransformConverter x:Key="A_Converter_MultiItemLiveTile_ItemMotionBlur"
                                    Scale="486" />

    <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangleStroke_MultiItemLiveTileBackground"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
        Thickness="{StaticResource A_Thickness_MultiItemLiveTileBackground_WithOffset}"/>

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

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_SelectionDot"
        BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
        CornerRadius="4"/>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_SelectionDot_Large"
        BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
        CornerRadius="7.5"/>

    <Style x:Key="A_Style_Tile_SelectionDots_Base" TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Color" Value="#FFB4B4B4"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_SelectionDot}"/>
    </Style>

    <local:LinearTransformConverter x:Key="A_Converter_MultiItemLiveTile_ScrollOffset"
                                    Scale="-486" />

    <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="local:BlendValue.Input" Value="{Binding (Selector.SelectedIndex), RelativeSource={RelativeSource Self}}"/>
        <Setter Property="local:BlendValue.InputChangedStoryboard" Value="{StaticResource A_Storyboard_MultiItemLiveTile_SmoothScroll}"/>
        <Setter Property="local:BindingProxy.C" Value="DisableMotionBlur"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <DockPanel HorizontalAlignment="Left"
                        Width="{Binding ActualWidth, ElementName=ItemsHost}">
                        <Decorator Width="{Binding Width, RelativeSource={RelativeSource AncestorType=Button}, Converter={StaticResource A_Converter_MultiItemLiveTile_ItemWidth}}"
                            DockPanel.Dock="Right">
                            <Decorator.LayoutTransform>
                                <ScaleTransform ScaleX="{Binding (local:BlendValue.Output), RelativeSource={RelativeSource TemplatedParent}}"/>
                            </Decorator.LayoutTransform>
                        </Decorator>
                        <Grid Style="{StaticResource A_Style_Grid_MotionBlur}"
                            local:MotionBlurEffect.MotionBlurPositionXControl="{Binding Path=(local:BlendValue.Output), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_Converter_MultiItemLiveTile_ItemMotionBlur}}">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_MotionBlurExpander}" />
                            <StackPanel x:Name="ItemsHost"
                                Orientation="Horizontal"
                                IsItemsHost="True"
                                HorizontalAlignment="Right">
                            </StackPanel>
                        </Grid>
                    </DockPanel>
                </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>

    <DataTemplate x:Key="A_DataTemplate_SelectionDot">
        <Decorator Width="{DynamicResource A_Double_SelectionDot_Width}"
                   Height="24"
                   Margin="{DynamicResource A_Thickness_SelectionDot_Margin}">
            <local:FZMaterial x:Name="ShadowMaterial"
                Style="{StaticResource A_Style_FZMaterial_FloatingIconShadow}"
                CaptureSubgraph="False"
                Margin="-20,0">
                <local:FZMaterial x:Name="DotMaterial"
                    Style="{DynamicResource A_Style_Tile_SelectionDots_Dynamic}"
                                  Width="{DynamicResource A_Double_SelectionDot_Width}"
                                  Height="{DynamicResource A_Double_SelectionDot_Height}"/>
            </local:FZMaterial>
        </Decorator>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=(Selector.IsSelected), RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}" Value="True">
                <Setter Property="Color" TargetName="DotMaterial" Value="{DynamicResource A_Color_Tile_Selected}"/>
                <Setter Property="CaptureSubgraph" TargetName="ShadowMaterial" Value="{DynamicResource A_Boolean_AllowShadows}"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

    <Style x:Key="A_Style_ContentControl_SelectionDotsContainer" TargetType="ContentControl">
        <Setter Property="Focusable" Value="False"/>
    </Style>

    <Style x:Key="A_Style_ItemsSelector_SelectionDots" TargetType="local:ItemsSelector">
        <Style.Resources>
            <System:Double x:Key="A_Double_SelectionDot_Width">8</System:Double>
            <System:Double x:Key="A_Double_SelectionDot_Height">8</System:Double>
            <Thickness x:Key="A_Thickness_SelectionDot_Margin">5,0</Thickness>
            <System:Boolean x:Key="A_Boolean_AllowShadows">True</System:Boolean>
            <Style x:Key="A_Style_Tile_SelectionDots_Dynamic" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_Tile_SelectionDots_Base}" />
        </Style.Resources>
        <Setter Property="FocusVisualStyle" Value="{StaticResource A_Style_BlankVisualStyle}" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource A_Style_ContentControl_SelectionDotsContainer}" />
        <Setter Property="ItemTemplate" Value="{StaticResource A_DataTemplate_SelectionDot}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <StackPanel IsItemsHost="true" Orientation="Horizontal" HorizontalAlignment="Center"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_ItemsSelector_SelectionDots_Alternate" TargetType="local:ItemsSelector" BasedOn="{StaticResource A_Style_ItemsSelector_SelectionDots}">
        <Style.Resources>
            <Style x:Key="A_Style_Tile_SelectionDots_Dynamic" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_Tile_SelectionDots_Base}">
                <Setter Property="Color" Value="#FFFFFFFF"/>
            </Style>
        </Style.Resources>
    </Style>


    <Style x:Key="A_Style_ItemsSelector_SelectionDots_Large" TargetType="local:ItemsSelector" BasedOn="{StaticResource A_Style_ItemsSelector_SelectionDots}">
        <Style.Resources>
            <System:Boolean x:Key="A_Boolean_AllowShadows">True</System:Boolean>
            <System:Double x:Key="A_Double_SelectionDot_Width">15</System:Double>
            <System:Double x:Key="A_Double_SelectionDot_Height">15</System:Double>
            <Thickness x:Key="A_Thickness_SelectionDot_Margin">8,0</Thickness>
            <Style x:Key="A_Style_Tile_SelectionDots_Dynamic" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_Tile_SelectionDots_Base}">
                <Setter Property="Color" Value="#FFFFFFFF"/>
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_SelectionDot_Large}"/>
            </Style>
        </Style.Resources>
    </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>
