<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary
    xmlns="www.team-mediaportal.com/2008/mpf/directx"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:system="clr-namespace:System"
    xmlns:collections="clr-namespace:MediaPortal.UI.Presentation.DataObjects;assembly=MediaPortal.UI"
    xmlns:mp_special_controls="clr-namespace:MediaPortal.UI.SkinEngine.SpecialElements.Controls;assembly=SkinEngine"
    DependsOnStyleResources="Colors,Buttons,Consts,MediaConsts,OtherControls"
    >

  <!-- BackgroundManager model -->
  <Model x:Key="BackgroundManagerModel" Id="1F4CAEDE-7108-483d-B5C8-18BEC7EC58E5"/>

  <ControlTemplate x:Key="DefaultBackgroundControlTemplate" TargetType="{x:Type Control}">
    <Grid Name="MainBackgroundGrid">
      <Grid.Resources>
        <!-- Basic color of the gradients -->
        <ResourceWrapper x:Key="BaseColorOpaque" Resource="#20405090" />
        <ResourceWrapper x:Key="BaseColorTransparent" Resource="#00405090" />

        <!-- Highlight colors -->
        <ResourceWrapper x:Key="HighlightColor1" Resource="#A0FFFFFF"/>
        <ResourceWrapper x:Key="HighlightColor2" Resource="#80FFFFFF"/>
        <ResourceWrapper x:Key="HighlightColor3" Resource="#60FFFFFF"/>
        <ResourceWrapper x:Key="HighlightColor4" Resource="#40FFFFFF"/>

        <!-- Animation color steps for basic color -->
        <ResourceWrapper x:Key="BaseColorStep1" Resource="#00405090"/>
        <ResourceWrapper x:Key="BaseColorStep2" Resource="#003A075B"/>
        <ResourceWrapper x:Key="BaseColorStep3" Resource="#00A0A0A0"/>

        <!-- Color animation storyboard -->
        <!--<Storyboard x:Key="ColorAnimation" FillBehavior="Stop">
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p1" Storyboard.TargetProperty="Fill.GradientStops[1].Color">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p2" Storyboard.TargetProperty="Fill.GradientStops[1].Color">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p3" Storyboard.TargetProperty="Fill.GradientStops[1].Color">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p4" Storyboard.TargetProperty="Fill.GradientStops[1].Color">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p5" Storyboard.TargetProperty="Fill.GradientStops[1].Color">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p6" Storyboard.TargetProperty="Fill.GradientStops[1].Color">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p7" Storyboard.TargetProperty="Fill.GradientStops[1].Color">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p1" Storyboard.TargetProperty="Fill.GradientStops[1].Stroke">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p2" Storyboard.TargetProperty="Fill.GradientStops[1].Stroke">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p3" Storyboard.TargetProperty="Fill.GradientStops[1].Stroke">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p4" Storyboard.TargetProperty="Fill.GradientStops[1].Stroke">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:02" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p5" Storyboard.TargetProperty="Fill.GradientStops[1].Stroke">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p6" Storyboard.TargetProperty="Fill.GradientStops[1].Stroke">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:02" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
        <ColorAnimationUsingKeyFrames RepeatBehavior="Forever" AutoReverse="true" BeginTime="00:00:00" Storyboard.TargetName="p7" Storyboard.TargetProperty="Fill.GradientStops[1].Stroke">
          <SplineColorKeyFrame KeyTime="00:00:00" Value="{StaticResource BaseColorStep1}"/>
          <SplineColorKeyFrame KeyTime="00:00:04" Value="{StaticResource BaseColorStep2}"/>
          <SplineColorKeyFrame KeyTime="00:00:06" Value="{StaticResource BaseColorStep3}"/>
        </ColorAnimationUsingKeyFrames>
      </Storyboard>-->

        <!-- Brushes definitions -->
        <RadialGradientBrush x:Key="rg1" MappingMode="Absolute" Center="469.92465,285.29697" GradientOrigin="469.92465,285.29697" RadiusX="255.10802" RadiusY="255.10802">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource HighlightColor3}" Offset="0"/>
              <!--<GradientStop Color="{Binding ElementName=ColorPlaceHolder, Path=Fill.Color}" Offset="1"/>-->
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="-0.591693, -0.211221, 0.79644, -2.23106, 492.145, 853.022"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>
        <RadialGradientBrush x:Key="rg2" MappingMode="Absolute" Center="221.302,169.04939" GradientOrigin="221.302,169.04939" RadiusX="264.94836" RadiusY="264.94836">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource HighlightColor3}" Offset="0"/>
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="0.461198, 2.03696, -1.06088, 0.240197, 341.402, -289.777"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>
        <RadialGradientBrush x:Key="rg3" MappingMode="Absolute" Center="927.0968,544.34473" GradientOrigin="927.0968,544.34473" RadiusX="641.26904" RadiusY="641.26904">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource HighlightColor1}" Offset="0"/>
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="0.593237, -0.424724, 0.144661, 0.202057, 298.363, 774.094"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>
        <RadialGradientBrush x:Key="rg4" MappingMode="Absolute" Center="636.61377,1328.2441" GradientOrigin="636.61377,1328.2441" RadiusX="640.72626" RadiusY="640.72626">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource BaseColorOpaque}" Offset="0"/>
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="-0.120978, -0.568841, 0.699044, -0.148669, 203.031, 1106.76"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>
        <RadialGradientBrush x:Key="rg5" MappingMode="Absolute" Center="958.22638,423.82761" GradientOrigin="958.22638,423.82761" RadiusX="217.0412" RadiusY="217.0412">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource HighlightColor1}" Offset="0"/>
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="1.20659, 0.646619, -1.0921, 2.03786, 273.937, -1052.66"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>
        <RadialGradientBrush x:Key="rg6" MappingMode="Absolute" Center="643.58197,1133.0995" GradientOrigin="643.58197,1133.0995" RadiusX="399.73447" RadiusY="399.73447">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource HighlightColor4}" Offset="0"/>
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="-1.35584, 0.852108, -0.106247, -0.169056, 2001.34, -83.2441"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>
        <RadialGradientBrush x:Key="rg7" MappingMode="Absolute" Center="680.95312,426.14899" GradientOrigin="680.95312,426.14899" RadiusX="499.87433" RadiusY="499.87433">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource HighlightColor2}" Offset="0"/>
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="0.458673, 0.705013, -0.903213, 0.587619, 753.522, -309.526"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>
        <RadialGradientBrush x:Key="rg8" MappingMode="Absolute" Center="-479.37695,458.63974" GradientOrigin="-479.37695,458.63974" RadiusX="578.16241" RadiusY="578.16241">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource BaseColorOpaque}" Offset="0"/>
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="-0.203649, 1.26372, -0.760339, -0.122529, 908.311, 686.188"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>
        <RadialGradientBrush x:Key="rg9" MappingMode="Absolute" Center="-1727.5338,499.29172" GradientOrigin="-1727.5338,499.29172" RadiusX="640" RadiusY="640">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource HighlightColor4}" Offset="0"/>
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="0.00787313, 0.239466, -0.838607, 0.0275717, 999.73, 420.886"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>
        <RadialGradientBrush x:Key="rg10" MappingMode="Absolute" Center="19.032259,701.93549" GradientOrigin="19.032259,701.93549" RadiusX="640" RadiusY="640">
          <RadialGradientBrush.GradientStops>
            <GradientStopCollection>
              <GradientStop Color="{StaticResource BaseColorOpaque}" Offset="0"/>
              <GradientStop Color="{StaticResource BaseColorTransparent}" Offset="1"/>
            </GradientStopCollection>
          </RadialGradientBrush.GradientStops>
          <RadialGradientBrush.Transform>
            <MatrixTransform Matrix="0.188552, 0.0033951, -0.0143815, 0.7987, 25.5386, 28.009"/>
          </RadialGradientBrush.Transform>
        </RadialGradientBrush>

        <!-- Background Manager for menu hovers -->
        <Model x:Key="BackgroundManagerModel" Id="1F4CAEDE-7108-483d-B5C8-18BEC7EC58E5"/>

      </Grid.Resources>
      <Canvas Name="svg2" Width="1280" Height="800">
        <!-- Black background -->
        <Canvas Name="Background">
          <Rectangle Canvas.Left="0" Canvas.Top="0" Width="1280" Height="800" Name="rect2160" Fill="#FF000000" StrokeThickness="1"/>
        </Canvas>

        <!-- The drawing objects -->
        <Canvas Name="layer13">
          <Rectangle Canvas.Left="0" Canvas.Top="0" Width="1280" Height="800" Name="rect12175" Fill="{StaticResource rg10}" StrokeThickness="1" />
        </Canvas>
        <Canvas Name="layer14">
          <Rectangle Canvas.Left="0" Canvas.Top="0" Width="1280" Height="800" Name="rect13155" Fill="{StaticResource rg9}" StrokeThickness="1" />
        </Canvas>
        <Canvas Name="layer5">
          <Path Name="p2" Fill="{StaticResource rg2}" Stroke="{StaticResource rg2}" StrokeThickness="2" Data="M 0 0 L 0 800 L 528.25 800 C 510.27908 725.87244 487.49729 647.55775 459.84375 566.5625 C 385.69566 349.38807 289.64211 150.8344 191.6875 0 L 0 0 z "/>
        </Canvas>
        <Canvas Name="layer3">
          <Path Name="path3215" Fill="#1A000000" StrokeThickness="1" Data="M 0 0 L 0 747.21875 C 159.26632 717.04795 263.79559 510.50262 236.28125 269.78125 C 224.53525 167.01616 190.54278 73.722053 142.6875 0 L 0 0 z "/>
        </Canvas>
        <Canvas Name="layer4">
          <Path Name="path4187" Fill="#FF000000" StrokeThickness="1" Data="M 0 0 L 0 800 L 214.53125 800 C 246.1183 701.96606 264.5 584.7624 264.5 458.875 C 264.5 277.39194 226.31608 113.95827 165.40625 0 L 0 0 z "/>
        </Canvas>
        <Canvas Name="layer6">
          <Path Name="p1" Fill="{StaticResource rg1}" Stroke="{StaticResource rg1}" StrokeThickness="2" Data="M 0 0 L 0 721.59375 C 156.32854 671.30405 319.02573 517.74119 420.71875 304.8125 C 470.08255 201.45272 498.96091 96.90102 508.4375 0 L 0 0 z "/>
        </Canvas>
        <Canvas Name="layer10">
          <Path Name="p3" Fill="{StaticResource rg3}" Stroke="{StaticResource rg3}" StrokeThickness="3" Data="M 0 0 L 0 800 L 303.71875 800 C 436.72259 761.9885 575.30234 709.08091 712.90625 641.625 C 948.63653 526.06577 1144.0238 386.20538 1280 245.6875 L 1280 0 L 0 0 z "/>
        </Canvas>
        <Canvas Name="layer7">
          <Path Name="p4" Fill="{StaticResource rg4}" Stroke="{StaticResource rg4}" StrokeThickness="1" Data="M 0 0 L 0 800.125 C 108.39172 718.93067 221.87561 712.82143 338.71875 701.375 C 702.2795 665.75911 1033.1814 584.88382 1280 481.5 L 1280 0 L 0 0 z "/>
        </Canvas>
        <Canvas Name="layer8">
          <Path Name="p5" Fill="{StaticResource rg5}" Stroke="{StaticResource rg5}" StrokeThickness="2" Data="M 1211.75 0 C 1067.0412 124.87589 935.03818 367.6617 873.125 651.65625 C 862.09958 702.22963 853.7785 751.82584 848.0625 800 L 1280 800 L 1280 0 L 1211.75 0 z "/>
        </Canvas>
        <Canvas Name="layer9">
          <Path Name="p6" Fill="{StaticResource rg6}" Stroke="{StaticResource rg6}" StrokeThickness="1" Data="M 1280 140.75 C 1176.6865 167.65395 1069.136 208.60781 964.28125 263.21875 C 669.33897 416.8319 483.50158 632.91141 481.875 800 L 1280 800 L 1280 140.75 z "/>
        </Canvas>
        <Canvas Name="layer11">
          <Path Name="p7" Fill="{StaticResource rg7}" Stroke="{StaticResource rg7}" StrokeThickness="2" Data="M 1271.9688 0 C 1176.6933 46.722139 1079.7373 100.5824 983.21875 161.21875 C 663.65515 361.97986 415.11679 595.0298 281.90625 800 L 1280 800 L 1280 0 L 1271.9688 0 z "/>
        </Canvas>
        <Canvas Name="layer12">
          <Path Name="p8" Fill="{StaticResource rg8}" Stroke="{StaticResource rg8}" StrokeThickness="1" Data="M 633.125 0 C 632.0816 0.82797861 631.04256 1.6372218 630 2.46875 C 344.87186 229.8823 162.15953 533.72822 124.75 800 L 1280 800 L 1280 0 L 633.125 0 z "/>
        </Canvas>
      </Canvas>

      <!-- Hovers -->
      <Image x:Name="BackdropImageBackground" Stretch="Uniform" Source="{Binding Source={StaticResource BackgroundManagerModel}, Path=BackgroundImage}" 
          Opacity="0.12"/>

      <!-- Trigger and ColorAnimation currently disabled, causing quite high CPU load -->
      <!--<Grid.Triggers>
      <EventTrigger RoutedEvent="UIElement.Loaded">
        <BeginStoryboard x:Name="Loaded_BeginStoryboard" HandoffBehavior="SnapshotAndReplace" Storyboard="{StaticResource ColorAnimation}"/>
      </EventTrigger>
    </Grid.Triggers>-->

    </Grid>
  </ControlTemplate>
  
</ResourceDictionary>
