Microsoft® Surface® Live Stream Code Sample

ive Stream enables businesses to engage their customers face-to-face using the most recent and relevant Twitter™, Flickr®, and RSS newsfeeds.

C# (5.9 MB)
 
 
 
 
 
4.3 Star
(4)
6,652 times
Add to favorites
4/19/2011
E-mail Twitter del.icio.us Digg Facebook

Solution explorer

C#
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:s="http://schemas.microsoft.com/surface/2008"
                    xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic"
                    xmlns:controls="clr-namespace:LiveStream.Controls"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:utils="clr-namespace:LiveStream.Helpers"
                    xmlns:helpers="clr-namespace:LiveStream.Helpers"
                    xmlns:rivercontent="clr-namespace:LiveStream.Controls.RiverContent"
                    xmlns:props="clr-namespace:LiveStream.Properties"
                    xmlns:local="clr-namespace:LiveStream"
                    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
                    mc:Ignorable="d">

  <props:Settings x:Key="Settings" />

  <ImageBrush x:Key="WindowBackground" Stretch="UniformToFill" ImageSource="/Resources/WindowBackground.png"/>

  <Color x:Key="ThemeColor" A="255" R="189" G="44" B="124" />
  <Color x:Key="ForegroundColor" A="255" R="255" G="255" B="255" />

  <SolidColorBrush x:Key="ThemeBrush" Color="{DynamicResource ThemeColor}" />
  <SolidColorBrush x:Key="ForegroundBrush" Color="{DynamicResource ForegroundColor}" />

  <FontFamily x:Key="MainFont">Segoe UI</FontFamily>
  <FontFamily x:Key="HeaderFont">/LiveStream;component/Fonts/#Segoe UI Light</FontFamily>

  <Style TargetType="{x:Type TextBlock}">
    <Setter Property="FontFamily" Value="{DynamicResource MainFont}" />
    <Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}"/>
  </Style>

  <Style TargetType="{x:Type controls:ManipulationViewport}" x:Key="ManipulationViewportStyle">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type controls:ManipulationViewport}">
          <Border>
            <ContentPresenter x:Name="PART_Content" Content="{TemplateBinding Content}" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type controls:Plane}" x:Key="PlaneStyle">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type controls:Plane}">
          <Grid>
            <!-- anti-aliasing is off here, but fear not... -->
            <Viewport3D x:Name="PART_Viewport" ClipToBounds="False" RenderOptions.EdgeMode="Aliased">
              <Viewport3D.Children>

                <!-- directional lights -->
                <ModelVisual3D x:Name="PART_DirectionalLights">
                  <ModelVisual3D.Content>
                    <Model3DGroup>
                      <DirectionalLight Color="White" Direction="0 0 -1" />
                      <DirectionalLight Color="White" Direction="0.1 -0.1 1" />
                    </Model3DGroup>
                  </ModelVisual3D.Content>
                </ModelVisual3D>

                <!-- ambient lights -->
                <ModelVisual3D x:Name="PART_AmbientLights">
                  <ModelVisual3D.Content>
                    <Model3DGroup>
                      <AmbientLight Color="White" />
                    </Model3DGroup>
                  </ModelVisual3D.Content>
                </ModelVisual3D>

                <!-- back -->
                <Viewport2DVisual3D x:Name="PART_BackModel" RenderOptions.CachingHint="Cache" RenderOptions.CacheInvalidationThresholdMaximum="2" RenderOptions.CacheInvalidationThresholdMinimum=".5">
                  <Viewport2DVisual3D.Geometry>
                    <MeshGeometry3D Positions="0 0 0, 0 1 0, 1 1 0, 1 0 0" TextureCoordinates="0 0, 0 1, 1 1, 1 0" TriangleIndices="1 2 0, 2 3 0" />
                  </Viewport2DVisual3D.Geometry>
                  <Viewport2DVisual3D.Transform>
                    <Transform3DGroup>
                      <ScaleTransform3D ScaleX="{Binding ElementName=PART_Scale, Path=ScaleX}" ScaleY="{Binding ElementName=PART_Scale, Path=ScaleY}" />
                      <RotateTransform3D CenterX="{Binding ElementName=PART_Rotate, Path=CenterX}" CenterY="{Binding ElementName=PART_Rotate, Path=CenterY}">
                        <RotateTransform3D.Rotation>
                          <QuaternionRotation3D Quaternion="{Binding ElementName=PART_Quaternion, Path=Quaternion}" />
                        </RotateTransform3D.Rotation>
                      </RotateTransform3D>
                    </Transform3DGroup>
                  </Viewport2DVisual3D.Transform>
                  <Viewport2DVisual3D.Material>
                    <DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/>
                  </Viewport2DVisual3D.Material>
                  <Viewport2DVisual3D.Visual>
                    <!-- the 1px transparent border here effectively turns anti-aliasing on, but is much faster than enabling it on the scene. -->
                    <!-- this will make all of your content 1px smaller than you expect it to be, but it's probably worth it. -->
                    <Border x:Name="PART_BackContent"
                            BorderThickness="1" BorderBrush="Transparent"
                            Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"
                            Padding="{TemplateBinding BackPadding}" RenderTransformOrigin=".5,.5">
                      <Border.RenderTransform>
                        <RotateTransform Angle="180" />
                      </Border.RenderTransform>
                      <ContentPresenter Content="{TemplateBinding BackContent}" ContentTemplate="{TemplateBinding BackContentTemplate}" />
                    </Border>
                  </Viewport2DVisual3D.Visual>
                </Viewport2DVisual3D>

                <!-- front -->
                <Viewport2DVisual3D x:Name="PART_FrontModel" RenderOptions.CachingHint="Cache" RenderOptions.CacheInvalidationThresholdMaximum="2" RenderOptions.CacheInvalidationThresholdMinimum=".5">
                  <Viewport2DVisual3D.Geometry>
                    <MeshGeometry3D Positions="0 0 0, 0 1 0, 1 1 0, 1 0 0" TextureCoordinates="0 1, 0 0, 1 0, 1 1" TriangleIndices="0 2 1, 0 3 2" />
                  </Viewport2DVisual3D.Geometry>
                  <Viewport2DVisual3D.Transform>
                    <Transform3DGroup>
                      <ScaleTransform3D x:Name="PART_Scale" />
                      <RotateTransform3D x:Name="PART_Rotate">
                        <RotateTransform3D.Rotation>
                          <QuaternionRotation3D x:Name="PART_Quaternion" />
                        </RotateTransform3D.Rotation>
                      </RotateTransform3D>
                    </Transform3DGroup>
                  </Viewport2DVisual3D.Transform>
                  <Viewport2DVisual3D.Material>
                    <DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/>
                  </Viewport2DVisual3D.Material>
                  <Viewport2DVisual3D.Visual>
                    <Border x:Name="PART_FrontContent" BorderThickness="1" BorderBrush="Transparent"
                            Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}"
                            Padding="{TemplateBinding FrontPadding}">
                      <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                    </Border>
                  </Viewport2DVisual3D.Visual>
                </Viewport2DVisual3D>

              </Viewport3D.Children>

              <Viewport3D.Camera>
                <PerspectiveCamera x:Name="PART_Camera" UpDirection="0 1 0" LookDirection="0 0 -1" />
              </Viewport3D.Camera>

            </Viewport3D>

            <Border x:Name="PART_FixedHiddenContainer" Visibility="Collapsed" />

            <!-- fixed content -->
            <Border x:Name="PART_FixedContainer">
              <Border.RenderTransform>
                <RotateTransform x:Name="PART_FixedTransform" />
              </Border.RenderTransform>
            </Border>

          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="AdminButtonStyle" TargetType="{x:Type s:SurfaceButton}">
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type s:SurfaceButton}">
          <ControlTemplate.Resources>
            <Storyboard x:Key="Press">
              <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="LayoutRoot">
                <SplineColorKeyFrame KeyTime="0:0:0.2" Value="Black"/>
              </ColorAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Release">
              <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="LayoutRoot">
                <SplineColorKeyFrame KeyTime="0:0:0.4" Value="#7F000000"/>
              </ColorAnimationUsingKeyFrames>
            </Storyboard>
          </ControlTemplate.Resources>
          <Grid x:Name="LayoutRoot" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Background="#7F000000">
            <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard Storyboard="{StaticResource Press}"/>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard Storyboard="{StaticResource Release}"/>
              </Trigger.ExitActions>
            </Trigger>
            <Trigger Property="IsEnabled" Value="True"/>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Foreground" Value="#A5333333"/>
              <Setter Property="Background" Value="Transparent"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="RiverContentItemStyle" TargetType="{x:Type controls:RiverContentItem}">
    <Setter Property="IsAdminTagPresent" Value="{Binding DataContext.IsAdminTagPresent, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:SurfaceWindow}}}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type controls:RiverContentItem}">
          <ControlTemplate.Resources>
            <Storyboard x:Key="FlashOn">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_cover">
                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="FlashOff">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_cover">
                <SplineDoubleKeyFrame KeyTime="0:0:0.35" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Breaking" AutoReverse="True" RepeatBehavior="3x">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_breaking">
                <SplineDoubleKeyFrame KeyTime="0:0:1.5" Value="0.6" KeySpline="1,0,1,1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="ShowAdmin">
              <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsHitTestVisible)" Storyboard.TargetName="PART_AdminControls">
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.2" Value="True"/>
              </BooleanAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_AdminControls">
                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="HideAdmin">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_AdminControls">
                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsHitTestVisible)" Storyboard.TargetName="PART_AdminControls">
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.2" Value="False"/>
              </BooleanAnimationUsingKeyFrames>
            </Storyboard>
          </ControlTemplate.Resources>
          <Grid d:DesignWidth="365.797" d:DesignHeight="352.287">
            <rivercontent:LargeImage x:Name="PART_LargeImage" Visibility="Collapsed" />
            <rivercontent:LargeNews x:Name="PART_LargeNews" Visibility="Collapsed" />
            <rivercontent:LargeTweet x:Name="PART_LargeTweet" Visibility="Collapsed" />
            <rivercontent:SmallImage x:Name="PART_SmallImage" Visibility="Collapsed" />
            <rivercontent:SmallNews x:Name="PART_SmallNews" Visibility="Collapsed" />
            <rivercontent:SmallTweet x:Name="PART_SmallTweet" Visibility="Collapsed" />
            <Border x:Name="_breaking" BorderBrush="{DynamicResource ForegroundBrush}" BorderThickness="2" Opacity="0" />
            <StackPanel x:Name="PART_AdminControls" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom" IsHitTestVisible="False" Opacity="0" Visibility="Visible">
              <s:SurfaceButton x:Name="PART_DeleteBtn" Width="40" Height="40" Padding="0" Style="{DynamicResource AdminButtonStyle}" Margin="0,0,2,0">
                <Grid>
                  <Ellipse Stroke="Red"	StrokeThickness="1" Margin="6.5" />
                  <Grid Margin="13" RenderTransformOrigin=".5,.5">
                    <Grid.RenderTransform>
                      <RotateTransform Angle="45" />
                    </Grid.RenderTransform>
                    <Rectangle Height="2" Fill="Red" />
                    <Rectangle Width="2" Fill="Red" />
                  </Grid>
                </Grid> 			
              </s:SurfaceButton>
              <s:SurfaceButton x:Name="PART_BanBtn" Width="40" Height="40" Padding="0" Style="{DynamicResource AdminButtonStyle}">
                <Grid>
                  <Ellipse Stroke="Red"	StrokeThickness="1" Margin="6.5" />
                    <Viewbox Width="13">
                      <Canvas Width="17.6692" Height="18.3685">
                        <Path Width="2.29028" Height="1.14453" Canvas.Left="11.8398" Canvas.Top="17.224" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 12.9851,17.224L 11.8398,18.3685L 14.1301,18.3685L 12.9851,17.224 Z "/>
                        <Path Width="10.9115" Height="10.7656" Canvas.Left="2.54159" Canvas.Top="0" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 7.35864,9.71228L 9.01172,8.05867C 9.51172,7.55867 10.3971,7.55867 10.8971,8.05867L 11.9655,9.12628C 12.8697,8.15761 13.453,6.8868 13.453,5.45575C 13.453,2.44281 11.0111,0 7.99731,0C 4.98438,0 2.54159,2.44281 2.54159,5.45575C 2.54159,8.11855 4.46476,10.2904 6.98958,10.7656C 6.9576,10.388 7.06958,10.0013 7.35864,9.71228 Z "/>
                        <Path Width="9.36776" Height="9.36721" Canvas.Left="8.30143" Canvas.Top="9.00134" Stretch="Fill" Fill="#FFFF0000" Data="F1 M 17.6692,10.6549L 16.0156,9.00134L 12.9851,12.0326L 9.95439,9.00134L 8.30143,10.6549L 11.332,13.6863L 8.302,16.7175L 9.95439,18.3685L 12.9851,15.3385L 16.0162,18.3685L 17.6685,16.7175L 14.638,13.6863L 17.6692,10.6549 Z "/>
                        <Path Width="9.44653" Height="7.94267" Canvas.Left="0" Canvas.Top="10.4259" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 7.35933,17.6601C 6.8385,17.1393 6.8385,16.2956 7.35933,15.7748L 9.44653,13.6863L 8.14905,12.388C 8.09892,12.392 8.04626,12.4011 7.99731,12.4011C 6.19397,12.4011 4.46997,11.2084 3.42839,10.4259C 0.889323,10.7227 0,11.6316 0,14.4153L 0,18.3685L 8.06893,18.3685L 7.35933,17.6601 Z "/>
                      </Canvas>
                    </Viewbox>
                </Grid> 			
              </s:SurfaceButton>
            </StackPanel>
            <Border x:Name="_cover" Opacity="0" IsHitTestVisible="False" Background="{DynamicResource ThemeBrush}"/>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsAdminTagPresent" Value="True">
              <Trigger.ExitActions>
                <BeginStoryboard x:Name="HideAdmin_BeginStoryboard" Storyboard="{StaticResource HideAdmin}"/>
              </Trigger.ExitActions>
              <Trigger.EnterActions>
                <BeginStoryboard x:Name="ShowAdmin_BeginStoryboard" Storyboard="{StaticResource ShowAdmin}"/>
              </Trigger.EnterActions>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="NotContentScatterViewItemStyle" TargetType="{x:Type s:ScatterViewItem}">
    <Setter Property="CanMove" Value="False" />
    <Setter Property="CanScale" Value="False" />
    <Setter Property="CanRotate" Value="False" />
    <Setter Property="IsTopmostOnActivation" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type s:ScatterViewItem}">
          <Border Margin="2" Opacity=".1" Background="{DynamicResource ForegroundBrush}"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="FlippingScatterViewItemStyle" TargetType="{x:Type s:ScatterViewItem}">
    <Setter Property="Background" Value="{x:Null}"/>
    <Setter Property="BorderBrush" Value="{DynamicResource ThemeBrush}"/>
    <Setter Property="Foreground" Value="#FF515151"/>
    <Setter Property="BorderThickness" Value="3"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="MinWidth" Value="48"/>
    <Setter Property="MinHeight" Value="48"/>
    <Setter Property="controls:Plane.PlaneUseLights" Value="False" />
    <Setter Property="controls:Plane.PlaneFieldOfView" Value="30" />
    <!-- The width and height should be 25px more than you actually want. The Front/Back padding should be 25, plus any additional reduction.
      This is needed so that the shadows look right during the flip. -->
    <Setter Property="controls:Plane.PlaneBackPadding" Value="25" />
    <Setter Property="controls:Plane.PlaneFrontPadding" Value="25" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type s:ScatterViewItem}">
          <ControlTemplate.Resources>
            <Storyboard x:Key="DeactivationTimeline">
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="activeBorder">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="activeBorderBack">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="shadow">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="shadowBack">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)" Storyboard.TargetName="shadow">
                <SplineDoubleKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="0:0:0.75" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)" Storyboard.TargetName="shadow">
                <SplineColorKeyFrame KeyTime="0:0:0.75" Value="#26000000"/>
              </ColorAnimationUsingKeyFrames>
              <PointAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="Sheen">
                <SplinePointKeyFrame KeySpline="0,0,0,0" KeyTime="0" Value="1.241,0.304"/>
                <SplinePointKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="0:0:0.75" Value="-0.636,0.132"/>
                <SplinePointKeyFrame KeyTime="0:0:0.775" Value="-1.146,-0.035"/>
              </PointAnimationUsingKeyFrames>
              <PointAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="Sheen">
                <SplinePointKeyFrame KeySpline="0,0,0,0" KeyTime="0" Value="1.879,0.551"/>
                <SplinePointKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="0:0:0.75" Value="0.018,0.291"/>
                <SplinePointKeyFrame KeyTime="0:0:0.775" Value="-0.492,0.124"/>
              </PointAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="containerBack">
                <SplineDoubleKeyFrame KeyTime="0" Value="1.03"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="1.01"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="containerBack">
                <SplineDoubleKeyFrame KeyTime="0" Value="1.03"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="1.01"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)" Storyboard.TargetName="shadowBack">
                <SplineDoubleKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="0:0:0.75" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)" Storyboard.TargetName="shadowBack">
                <SplineColorKeyFrame KeyTime="0:0:0.75" Value="#26000000"/>
              </ColorAnimationUsingKeyFrames>
              <PointAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="SheenBack">
                <SplinePointKeyFrame KeySpline="0,0,0,0" KeyTime="0" Value="1.241,0.304"/>
                <SplinePointKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="0:0:0.75" Value="-0.636,0.132"/>
                <SplinePointKeyFrame KeyTime="0:0:0.775" Value="-1.146,-0.035"/>
              </PointAnimationUsingKeyFrames>
              <PointAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="SheenBack">
                <SplinePointKeyFrame KeySpline="0,0,0,0" KeyTime="0" Value="1.879,0.551"/>
                <SplinePointKeyFrame KeySpline="0,0,0.15,0.93" KeyTime="0:0:0.75" Value="0.018,0.291"/>
                <SplinePointKeyFrame KeyTime="0:0:0.775" Value="-0.492,0.124"/>
              </PointAnimationUsingKeyFrames>
              <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(controls:Plane.IsPaddingClippingEnabled)" Storyboard.TargetName="plane">
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.75" Value="True"/>
              </BooleanAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="ActivationTimeline">
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="activeBorder">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="activeBorderBack">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="shadow">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="shadowBack">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="0:0:0.75" Value="1"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)" Storyboard.TargetName="shadow">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.45" Value="25"/>
              </DoubleAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)" Storyboard.TargetName="shadow">
                <SplineColorKeyFrame KeyTime="0" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.45" Value="#55000000"/>
              </ColorAnimationUsingKeyFrames>
              <PointAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="Sheen">
                <SplinePointKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:1.1" Value="1.182,0.441"/>
              </PointAnimationUsingKeyFrames>
              <PointAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="Sheen">
                <SplinePointKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:1.1" Value="1.929,0.949"/>
              </PointAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Storyboard.TargetName="containerBack">
                <SplineDoubleKeyFrame KeyTime="0" Value="1.01"/>
                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.45" Value="1.03"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="containerBack">
                <SplineDoubleKeyFrame KeyTime="0" Value="1.01"/>
                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.45" Value="1.03"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)" Storyboard.TargetName="shadowBack">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.45" Value="25"/>
              </DoubleAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)" Storyboard.TargetName="shadowBack">
                <SplineColorKeyFrame KeyTime="0" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.45" Value="#55000000"/>
              </ColorAnimationUsingKeyFrames>
              <PointAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="SheenBack">
                <SplinePointKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:1.1" Value="1.182,0.441"/>
              </PointAnimationUsingKeyFrames>
              <PointAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="SheenBack">
                <SplinePointKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:1.1" Value="1.929,0.949"/>
              </PointAnimationUsingKeyFrames>
              <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(controls:Plane.IsPaddingClippingEnabled)" Storyboard.TargetName="plane">
                <DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
              </BooleanAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Flip">
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="shadow" FillBehavior="Stop">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="shadowBack" FillBehavior="Stop">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(controls:Plane.IsPaddingClippingEnabled)" Storyboard.TargetName="plane" FillBehavior="Stop">
                <DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.3" Value="True"/>
              </BooleanAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(controls:Plane.RotationX)" Storyboard.TargetName="plane">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.15" Value="90"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="180"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)" Storyboard.TargetName="shadow" FillBehavior="Stop">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.15" Value="25"/>
                <SplineDoubleKeyFrame KeySpline="0,0,1,0" KeyTime="0:0:0.3" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <ThicknessAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="shadow" FillBehavior="Stop">
                <SplineThicknessKeyFrame KeyTime="0" Value="-3"/>
                <SplineThicknessKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.15" Value="0"/>
                <SplineThicknessKeyFrame KeySpline="0,0,1,0" KeyTime="0:0:0.3" Value="-3"/>
              </ThicknessAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)" Storyboard.TargetName="shadow" FillBehavior="Stop">
                <SplineColorKeyFrame KeyTime="0" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.25" Value="#14000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.5" Value="#55000000"/>
              </ColorAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)" Storyboard.TargetName="shadowBack" FillBehavior="Stop">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.15" Value="25"/>
                <SplineDoubleKeyFrame KeySpline="0,0,1,0" KeyTime="0:0:0.3" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <ThicknessAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="shadowBack" FillBehavior="Stop">
                <SplineThicknessKeyFrame KeyTime="0" Value="-3"/>
                <SplineThicknessKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.15" Value="0"/>
                <SplineThicknessKeyFrame KeySpline="0,0,1,0" KeyTime="0:0:0.3" Value="-3"/>
              </ThicknessAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)" Storyboard.TargetName="shadowBack" FillBehavior="Stop">
                <SplineColorKeyFrame KeyTime="0" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.15" Value="#14000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.3" Value="#55000000"/>
              </ColorAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Unflip">
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="shadow" FillBehavior="Stop">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="shadowBack" FillBehavior="Stop">
                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(controls:Plane.IsPaddingClippingEnabled)" Storyboard.TargetName="plane" FillBehavior="Stop">
                <DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.3" Value="True"/>
              </BooleanAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(controls:Plane.RotationX)" Storyboard.TargetName="plane">
                <SplineDoubleKeyFrame KeyTime="0" Value="180"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.15" Value="270"/>
                <SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="360"/>
              </DoubleAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)" Storyboard.TargetName="shadow" FillBehavior="Stop">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.15" Value="25"/>
                <SplineDoubleKeyFrame KeySpline="0,0,1,0" KeyTime="0:0:0.3" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <ThicknessAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="shadow" FillBehavior="Stop">
                <SplineThicknessKeyFrame KeyTime="0" Value="-3"/>
                <SplineThicknessKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.15" Value="0"/>
                <SplineThicknessKeyFrame KeySpline="0,0,1,0" KeyTime="0:0:0.3" Value="-3"/>
              </ThicknessAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)" Storyboard.TargetName="shadow" FillBehavior="Stop">
                <SplineColorKeyFrame KeyTime="0" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.25" Value="#14000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.5" Value="#55000000"/>
              </ColorAnimationUsingKeyFrames>
              <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.MaximumShadowOffset)" Storyboard.TargetName="shadowBack" FillBehavior="Stop">
                <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.15" Value="25"/>
                <SplineDoubleKeyFrame KeySpline="0,0,1,0" KeyTime="0:0:0.3" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
              <ThicknessAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="shadowBack" FillBehavior="Stop">
                <SplineThicknessKeyFrame KeyTime="0" Value="-3"/>
                <SplineThicknessKeyFrame KeySpline="0,1,1,1" KeyTime="0:0:0.15" Value="0"/>
                <SplineThicknessKeyFrame KeySpline="0,0,1,0" KeyTime="0:0:0.3" Value="-3"/>
              </ThicknessAnimationUsingKeyFrames>
              <ColorAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome.Color)" Storyboard.TargetName="shadowBack" FillBehavior="Stop">
                <SplineColorKeyFrame KeyTime="0" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.15" Value="#14000000"/>
                <SplineColorKeyFrame KeyTime="0:0:0.3" Value="#55000000"/>
              </ColorAnimationUsingKeyFrames>
            </Storyboard>
          </ControlTemplate.Resources>
          <controls:Plane x:Name="plane" Style="{DynamicResource PlaneStyle}"
                       Width="{TemplateBinding ActualWidth}"
                       Height="{TemplateBinding ActualHeight}"
                       RotationX="{TemplateBinding controls:Plane.PlaneRotationX}"
                       RotationY="{TemplateBinding controls:Plane.PlaneRotationY}"
                       RotationZ="{TemplateBinding controls:Plane.PlaneRotationZ}"
                       RotationCenterX="{TemplateBinding controls:Plane.PlaneRotationCenterX}"
                       RotationCenterY="{TemplateBinding controls:Plane.PlaneRotationCenterY}"
                       RotationCenterZ="{TemplateBinding controls:Plane.PlaneRotationCenterZ}"
                       FieldOfView="{TemplateBinding controls:Plane.PlaneFieldOfView}"
                       UseLights="{TemplateBinding controls:Plane.PlaneUseLights}"
                       CacheInvalidationThresholdMaximum="{TemplateBinding controls:Plane.PlaneCacheInvalidationThresholdMaximum}"
                       CacheInvalidationThresholdMinimum="{TemplateBinding controls:Plane.PlaneCacheInvalidationThresholdMinimum}"
                       FrontPadding="{TemplateBinding controls:Plane.PlaneFrontPadding}"
                       BackPadding="{TemplateBinding controls:Plane.PlaneBackPadding}" RenderTransformOrigin="0.5,0.5">
            <controls:Plane.BackContent>
              <Grid x:Name="containerBack" RenderTransformOrigin=".5,.5">
                <Grid.RenderTransform>
                  <RotateTransform Angle="180" />
                </Grid.RenderTransform>
                <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="shadowBack" Color="#33000000" ShadowVector="{TemplateBinding ShadowVector}" Opacity="0"/>
                <Border x:Name="activeBorderBack" BorderBrush="{DynamicResource ThemeBrush}" BorderThickness="3" Margin="-5" Opacity="0" />
                <Border x:Name="contentBorderBack" RenderTransformOrigin=".5,.5" Margin="1">
                  <Border.RenderTransform>
                    <RotateTransform Angle="180" />
                  </Border.RenderTransform>
                  <rivercontent:TagBack IsFlipped="{Binding Path=(helpers:ScatterFlip.IsFlipped), RelativeSource={RelativeSource AncestorType={x:Type s:ScatterViewItem}, Mode=FindAncestor}}" RenderTransformOrigin=".5,.5">
                    <rivercontent:TagBack.RenderTransform>
                      <RotateTransform Angle="180" />
                    </rivercontent:TagBack.RenderTransform>
                  </rivercontent:TagBack>
                </Border>
                <Rectangle x:Name="SheenBack" Focusable="False" HorizontalAlignment="Stretch" IsHitTestVisible="False" Opacity="0.6" VerticalAlignment="Stretch">
                  <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="-0.234,0.37" StartPoint="-0.981,-0.138">
                      <GradientStop Color="Transparent" Offset="0"/>
                      <GradientStop Color="#33FFFFFF" Offset="0.52"/>
                      <GradientStop Color="Transparent" Offset="1"/>
                    </LinearGradientBrush>
                  </Rectangle.Fill>
                </Rectangle>
              </Grid>
            </controls:Plane.BackContent>
            <Grid x:Name="container" RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}">
              <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="shadow" Color="#33000000" ShadowVector="{TemplateBinding ShadowVector}" Opacity="0"/>
              <Border x:Name="activeBorder" BorderBrush="{DynamicResource ThemeBrush}" BorderThickness="3" Margin="-5" Opacity="0" />
              <Border x:Name="contentBorder" Margin="1">
                <controls:RiverContentItem Backside="{Binding BackContent, RelativeSource={RelativeSource AncestorType={x:Type controls:Plane}, Mode=FindAncestor}}" Style="{DynamicResource RiverContentItemStyle}"/>
              </Border>
              <Rectangle x:Name="Sheen" Focusable="False" HorizontalAlignment="Stretch" IsHitTestVisible="False" Opacity="0.6" VerticalAlignment="Stretch">
                <Rectangle.Fill>
                  <LinearGradientBrush EndPoint="-0.234,0.37" StartPoint="-0.981,-0.138">
                    <GradientStop Color="Transparent" Offset="0"/>
                    <GradientStop Color="#33FFFFFF" Offset="0.52"/>
                    <GradientStop Color="Transparent" Offset="1"/>
                  </LinearGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
            </Grid>
          </controls:Plane>
          <ControlTemplate.Triggers>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsActive" Value="True"/>
                <Condition Property="ShowsActivationEffects" Value="True"/>
              </MultiTrigger.Conditions>
              <MultiTrigger.EnterActions>
                <BeginStoryboard x:Name="ActivationTimeline_BeginStoryboard" Storyboard="{StaticResource ActivationTimeline}" />
              </MultiTrigger.EnterActions>
              <MultiTrigger.ExitActions>
                <BeginStoryboard x:Name="DeactivationTimeline_BeginStoryboard" Storyboard="{StaticResource DeactivationTimeline}"/>
              </MultiTrigger.ExitActions>
            </MultiTrigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Background" TargetName="contentBorder">
                <Setter.Value>
                  <LinearGradientBrush EndPoint="0,0" StartPoint="0,1">
                    <GradientStop Color="#4CA4B4BD" Offset="0"/>
                    <GradientStop Color="#4CDFE9EE" Offset="1"/>
                  </LinearGradientBrush>
                </Setter.Value>
              </Setter>
              <Setter Property="Foreground" Value="#A5333333"/>
              <Setter Property="BorderBrush" Value="#33000000"/>
            </Trigger>
            <Trigger Property="helpers:ScatterFlip.IsFlipped" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard Storyboard="{StaticResource Flip}" />
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard Storyboard="{StaticResource Unflip}" />
              </Trigger.ExitActions>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <ControlTemplate x:Key="RiverLayout">
    <Grid d:DesignWidth="5208" d:DesignHeight="420">
      <Grid.Resources>
        <Style x:Key="DesignGridCell" TargetType="{x:Type Rectangle}">
          <Setter Property="Fill" Value="#FFA70D0D" />
          <Setter Property="Stroke" Value="White" />
          <Setter Property="Margin" Value="2" />
        </Style>
      </Grid.Resources>

      <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition />
        <RowDefinition />
        <RowDefinition />
        <RowDefinition />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
        <ColumnDefinition />
      </Grid.ColumnDefinitions>

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="3" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="2" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="3" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="5" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="6" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="6" Grid.ColumnSpan="1" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="7" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="9" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="7" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="6" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="9" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="10" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="10" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="10" Grid.ColumnSpan="2" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="11" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="11" Grid.ColumnSpan="2" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="11" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="12" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="13" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="14" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="14" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="15" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="15" Grid.ColumnSpan="2" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="16" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="17" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="19" Grid.ColumnSpan="2" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="17" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="18" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="18" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="17" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="20" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="21" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="22" Grid.ColumnSpan="2" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="21" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="21" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="23" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="24" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="24" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="23" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="25" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="25" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="27" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="30" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="26" Grid.ColumnSpan="2" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="28" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="26" Grid.ColumnSpan="2" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="28" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="29" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="29" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="31" Grid.ColumnSpan="1" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="31" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="31" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="32" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="33" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="33" Grid.ColumnSpan="2" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="33" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="32" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="34" Grid.ColumnSpan="2" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="35" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="36" Grid.ColumnSpan="2" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="38" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="39" Grid.ColumnSpan="1" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="39" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="36" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="37" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="36" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="40" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="40" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="40" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="41" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="41" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="43" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="43" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="44" Grid.ColumnSpan="2" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="46" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="44" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="45" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="44" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="45" Grid.ColumnSpan="2" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="45" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="47" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="48" Grid.ColumnSpan="1" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="48" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="49" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="49" Grid.ColumnSpan="2" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="50" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="51" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="54" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="52" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="51" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="52" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="53" Grid.ColumnSpan="2" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="51" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />

      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="55" Grid.ColumnSpan="2" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="55" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="55" Grid.ColumnSpan="2" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="3" Grid.Column="57" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="55" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="57" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="57" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="1" Grid.Column="58" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="2" Grid.Column="58" Grid.ColumnSpan="3" Grid.RowSpan="2" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="58" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="4" Grid.Column="59" Grid.ColumnSpan="3" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="60" Grid.ColumnSpan="1" Grid.RowSpan="1" controls:River.ItemStyle="{StaticResource NotContentScatterViewItemStyle}" />
      <Rectangle Style="{StaticResource DesignGridCell}" Grid.Row="0" Grid.Column="61" Grid.ColumnSpan="1" Grid.RowSpan="3" controls:River.ItemStyle="{StaticResource FlippingScatterViewItemStyle}" />
    </Grid>
  </ControlTemplate>
  <Style x:Key="CloseButtonStyle" TargetType="{x:Type s:SurfaceButton}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="FocusVisualStyle">
      <Setter.Value>
        <Style>
          <Setter Property="Control.Template">
            <Setter.Value>
              <ControlTemplate/>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Foreground" Value="{DynamicResource ThemeBrush}"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Padding" Value="0"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Focusable" Value="False"/>
    <Setter Property="MinWidth" Value="0"/>
    <Setter Property="MinHeight" Value="0"/>
    <Setter Property="Width" Value="40"/>
    <Setter Property="Height" Value="40"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type s:SurfaceButton}">
          <ControlTemplate.Resources>
            <Storyboard x:Key="Press">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_background">
                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0.4"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Release">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_background">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </ControlTemplate.Resources>
          <Grid x:Name="Grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <Border x:Name="_background" Background="White" Opacity="0"/>
            <controls:CloseTimer Style="{DynamicResource CloseTimerStyle}" Foreground="{TemplateBinding Foreground}" Background="{TemplateBinding Background}" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard Storyboard="{StaticResource Press}"/>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard x:Name="Release_BeginStoryboard" Storyboard="{StaticResource Release}"/>
              </Trigger.ExitActions>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ImageCloseButtonStyle" TargetType="{x:Type s:SurfaceButton}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="FocusVisualStyle">
      <Setter.Value>
        <Style>
          <Setter Property="Control.Template">
            <Setter.Value>
              <ControlTemplate/>
            </Setter.Value>
          </Setter>
        </Style>
      </Setter.Value>
    </Setter>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}"/>
    <Setter Property="Background" Value="{DynamicResource ThemeBrush}"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Padding" Value="0"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="Focusable" Value="False"/>
    <Setter Property="MinWidth" Value="0"/>
    <Setter Property="MinHeight" Value="0"/>
    <Setter Property="Width" Value="40"/>
    <Setter Property="Height" Value="40"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type s:SurfaceButton}">
          <ControlTemplate.Resources>
            <Storyboard x:Key="Press">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_background">
                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0.9"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Release">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="_background">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value=".5"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </ControlTemplate.Resources>
          <Grid x:Name="Grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <Border x:Name="_background" Background="{TemplateBinding Background}" Opacity=".5"/>
            <controls:CloseTimer Style="{DynamicResource CloseTimerStyle}" Foreground="{TemplateBinding Foreground}" Background="{TemplateBinding Foreground}" />
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard Storyboard="{StaticResource Press}"/>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard x:Name="Release_BeginStoryboard" Storyboard="{StaticResource Release}"/>
              </Trigger.ExitActions>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="CloseTimerStyle" TargetType="{x:Type controls:CloseTimer}">
    <Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type controls:CloseTimer}">
          <Grid x:Name="PART_LayoutRoot">
            <Grid.Resources>
              <Storyboard x:Key="Timeout" FillBehavior="Stop">
                <ThicknessAnimation Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="_fill" BeginTime="0:0:10" Duration="0:0:5" To="0" FillBehavior="Stop" />
              </Storyboard>
            </Grid.Resources>
            <Rectangle x:Name="_fill" Fill="{TemplateBinding Background}" Margin="0,40,0,0" Opacity="0.4" />
            <Ellipse Width="20" Height="20" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" />
            <Rectangle Width="8" Height="2" Fill="{TemplateBinding Foreground}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="BackFlipButtonStyle" TargetType="{x:Type s:SurfaceButton}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type s:SurfaceButton}">
          <ControlTemplate.Resources>
            <Storyboard x:Key="Press">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0.7"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Release">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="0.5"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </ControlTemplate.Resources>
          <Grid x:Name="Grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Width="40" Height="40">
            <Border x:Name="border" Background="{DynamicResource ThemeBrush}"	Opacity=".5" />
            <Ellipse Width="20" Height="20" Stroke="{DynamicResource ForegroundBrush}" StrokeThickness="1" />
            <Path Width="8.5" Height="8.5" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 11.4013,10.1147L 4.552,3.26538L 9.33203,3.26538L 9.33203,0.598714L 2.66667,0.598714L 2.66667,0.596028L 0,0.598714L 0,9.93205L 2.66536,9.93205L 2.66667,5.15072L 9.51603,12L 11.4013,10.1147 Z "/>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard Storyboard="{StaticResource Press}"/>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard x:Name="Release_BeginStoryboard" Storyboard="{StaticResource Release}"/>
              </Trigger.ExitActions>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="FrontFlipButtonStyle" TargetType="{x:Type s:SurfaceButton}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type s:SurfaceButton}">
          <ControlTemplate.Resources>
            <Storyboard x:Key="Press">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0.4"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Release">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="0.2"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </ControlTemplate.Resources>
          <Grid x:Name="Grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Width="40" Height="40">
            <Border x:Name="border" Background="{DynamicResource ForegroundBrush}"	Opacity=".2" />
            <Ellipse Width="20" Height="20" Stroke="{DynamicResource ForegroundBrush}" StrokeThickness="1" />
            <Path Width="8.5" Height="8.5" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 11.4013,10.1147L 4.552,3.26538L 9.33203,3.26538L 9.33203,0.598714L 2.66667,0.598714L 2.66667,0.596028L 0,0.598714L 0,9.93205L 2.66536,9.93205L 2.66667,5.15072L 9.51603,12L 11.4013,10.1147 Z " RenderTransformOrigin=".5,.5">
              <Path.RenderTransform>
                <RotateTransform Angle="180" />
              </Path.RenderTransform>
            </Path>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard Storyboard="{StaticResource Press}"/>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard x:Name="Release_BeginStoryboard" Storyboard="{StaticResource Release}"/>
              </Trigger.ExitActions>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ImageFlipButtonStyle" TargetType="{x:Type s:SurfaceButton}">
    <Setter Property="Background" Value="{DynamicResource ForegroundBrush}" />
    <Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}" />
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type s:SurfaceButton}">
          <ControlTemplate.Resources>
            <Storyboard x:Key="Press">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
                <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0.9"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="Release">
              <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
                <SplineDoubleKeyFrame KeyTime="0:0:0.4" Value="0.5"/>
              </DoubleAnimationUsingKeyFrames>
            </Storyboard>
          </ControlTemplate.Resources>
          <Grid x:Name="Grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Width="40" Height="40">
            <Border x:Name="border" Background="{TemplateBinding Background}"	Opacity=".5" />
            <Ellipse Width="20" Height="20" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" />
            <Path Width="8.5" Height="8.5" Stretch="Fill" Fill="#FFFFFFFF" Data="F1 M 11.4013,10.1147L 4.552,3.26538L 9.33203,3.26538L 9.33203,0.598714L 2.66667,0.598714L 2.66667,0.596028L 0,0.598714L 0,9.93205L 2.66536,9.93205L 2.66667,5.15072L 9.51603,12L 11.4013,10.1147 Z " RenderTransformOrigin=".5,.5">
              <Path.RenderTransform>
                <RotateTransform Angle="180" />
              </Path.RenderTransform>
            </Path>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
              <Trigger.EnterActions>
                <BeginStoryboard Storyboard="{StaticResource Press}"/>
              </Trigger.EnterActions>
              <Trigger.ExitActions>
                <BeginStoryboard x:Name="Release_BeginStoryboard" Storyboard="{StaticResource Release}"/>
              </Trigger.ExitActions>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ImageLoaderStyle" TargetType="{x:Type controls:ImageLoader}">
    <Setter Property="Foreground" Value="{DynamicResource ForegroundBrush}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type controls:ImageLoader}">
        	<ControlTemplate.Resources>
        		<Storyboard x:Key="Loaded">
        			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_Loader">
        				<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
        			</DoubleAnimationUsingKeyFrames>
        			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_Image">
        				<SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
        			</DoubleAnimationUsingKeyFrames>
        			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PART_Loader">
        				<DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="{x:Static Visibility.Collapsed}"/>
        			</ObjectAnimationUsingKeyFrames>
        			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PART_Image">
        				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
        				<DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="{x:Static Visibility.Visible}"/>
        			</ObjectAnimationUsingKeyFrames>
        		</Storyboard>
        		<Storyboard x:Key="Loading">
        			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_Image">
        				<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
        			</DoubleAnimationUsingKeyFrames>
        			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_Loader">
        				<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
        			</DoubleAnimationUsingKeyFrames>
        			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PART_Image">
        				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
        			</ObjectAnimationUsingKeyFrames>
        			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PART_Loader">
        				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
        			</ObjectAnimationUsingKeyFrames>
        		</Storyboard>
        		<Storyboard x:Key="Spin" RepeatBehavior="Forever">
        			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="_dots">
        				<SplineDoubleKeyFrame KeyTime="0:0:1" Value="360"/>
        			</DoubleAnimationUsingKeyFrames>
        		</Storyboard>
        	</ControlTemplate.Resources>
          <Grid x:Name="PART_LayoutRoot" ClipToBounds="True" d:DesignWidth="184.176" d:DesignHeight="168">
        		<StackPanel x:Name="PART_Loader" HorizontalAlignment="Center" VerticalAlignment="Center">
        			<Grid x:Name="_dots" Width="35" Height="35" RenderTransformOrigin="0.5,0.5">
        				<Grid.RenderTransform>
        					<TransformGroup>
        						<ScaleTransform/>
        						<SkewTransform/>
        						<RotateTransform/>
        						<TranslateTransform/>
        					</TransformGroup>
        				</Grid.RenderTransform>
        				<Ellipse Fill="{TemplateBinding Foreground}" Width="8" Height="8" HorizontalAlignment="Center" VerticalAlignment="Top" />
        				<Ellipse Fill="{TemplateBinding Foreground}" Width="8" Height="8" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
        			</Grid>
        			<StackPanel Orientation="Horizontal" Opacity=".75" Margin="0,25,0,-38.3">
        				<TextBlock Text="loading " FontWeight="Bold" FontSize="10" Foreground="{TemplateBinding Foreground}" />
        				<TextBlock Text="{TemplateBinding Label}" FontWeight="Bold" FontSize="10" Foreground="{TemplateBinding Foreground}" />
        			</StackPanel>
        		</StackPanel>
        		<Image x:Name="PART_Image" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="{TemplateBinding Stretch}" Opacity="0" />
        	</Grid>
        	<ControlTemplate.Triggers>
        		<Trigger Property="IsImageLoading" Value="True">
        			<Trigger.EnterActions>
        				<BeginStoryboard x:Name="Loading_BeginStoryboard" Storyboard="{StaticResource Loading}"/>
        				<BeginStoryboard x:Name="Spin_BeginStoryboard" Storyboard="{StaticResource Spin}"/>
        			</Trigger.EnterActions>
        			<Trigger.ExitActions>
        				<BeginStoryboard Storyboard="{StaticResource Loaded}"/>
        				<StopStoryboard BeginStoryboardName="Spin_BeginStoryboard"/>
        			</Trigger.ExitActions>
        		</Trigger>
        	</ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>