src/FingersDance/MainSurfaceWindow.xaml
changeset 106 9dfc0ee0ab17
parent 89 f9a931434910
child 112 08bc8eac9e71
--- a/src/FingersDance/MainSurfaceWindow.xaml	Thu Sep 24 10:42:34 2009 +0200
+++ b/src/FingersDance/MainSurfaceWindow.xaml	Thu Sep 24 15:21:52 2009 +0200
@@ -7,16 +7,123 @@
     xmlns:FingersDance_Control_Pivot="clr-namespace:FingersDance.Control.Pivot;assembly=FingersDance.Control.Pivot"
     
     
+    xmlns:FingersDance_Control_SessionInput1="clr-namespace:FingersDance.Control.SessionInput;assembly=FingersDance.Control.SaisieSeance"
+    
+    
+    xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic"
+    
+    
     x:Class="FingersDance.SurfaceWindow1"
     Title="FingersDance"
     Width="1024" Height="768" x:Name="mainSurfaceWindow" 
     Background="{x:Null}"
-    xmlns:FingersDance_Control_SessionInput1="clr-namespace:FingersDance.Control.SessionInput;assembly=FingersDance.Control.SaisieSeance"
     
     
     >
   <s:SurfaceWindow.Resources>
     <ImageBrush x:Key="WindowBackground" Stretch="None" Opacity="0.6" ImageSource="pack://application:,,,/Resources/WindowBackground.jpg"/>
+  	<Style x:Key="FingersDance.Control.ScatterView" TargetType="{x:Type s:ScatterViewItem}">
+  		<Setter Property="Background">
+  			<Setter.Value>
+  				<LinearGradientBrush EndPoint="0,0" StartPoint="0,1">
+  					<GradientStop Color="#FFA4B4BD" Offset="0"/>
+  					<GradientStop Color="#FFDFE9EE" Offset="1"/>
+  				</LinearGradientBrush>
+  			</Setter.Value>
+  		</Setter>
+  		<Setter Property="BorderBrush" Value="#33000000"/>
+  		<Setter Property="Foreground" Value="#FF515151"/>
+  		<Setter Property="BorderThickness" Value="1"/>
+  		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
+  		<Setter Property="VerticalContentAlignment" Value="Stretch"/>
+  		<Setter Property="MinWidth" Value="48"/>
+  		<Setter Property="MinHeight" Value="48"/>
+  		<Setter Property="Template">
+  			<Setter.Value>
+  				<ControlTemplate TargetType="{x:Type s:ScatterViewItem}">
+  					<ControlTemplate.Resources>
+  						<Storyboard x:Key="ActivationTimeline">
+  							<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
+  								<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.01"/>
+  								<SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="1.03"/>
+  							</DoubleAnimationUsingKeyFrames>
+  							<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
+  								<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.01"/>
+  								<SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="1.03"/>
+  							</DoubleAnimationUsingKeyFrames>
+  						</Storyboard>
+  						<Storyboard x:Key="DeactivationTimeline">
+  							<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
+  								<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.03"/>
+  								<SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="00:00:00.7500000" Value="1.01"/>
+  							</DoubleAnimationUsingKeyFrames>
+  							<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
+  								<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.03"/>
+  								<SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="00:00:00.7500000" Value="1.01"/>
+  							</DoubleAnimationUsingKeyFrames>
+  						</Storyboard>
+  					</ControlTemplate.Resources>
+  					<Grid x:Name="container" RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}">
+  						<Grid.RenderTransform>
+  							<ScaleTransform ScaleX="1" ScaleY="1"/>
+  						</Grid.RenderTransform>
+  						<Border x:Name="contentBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
+  							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
+  						</Border>
+  						<Rectangle x:Name="Sheen" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Focusable="False" IsHitTestVisible="False" Opacity="0.6" Fill="{x:Null}"/>
+  					</Grid>
+  					<ControlTemplate.Triggers>
+  						<MultiTrigger>
+  							<MultiTrigger.Conditions>
+  								<Condition Property="IsActive" Value="True"/>
+  								<Condition Property="ShowsActivationEffects" Value="True"/>
+  							</MultiTrigger.Conditions>
+  							<MultiTrigger.ExitActions>
+  								<BeginStoryboard x:Name="DeactivationTimeline_BeginStoryboard">
+  									<Storyboard>
+  										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
+  											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.03"/>
+  											<SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="00:00:00.7500000" Value="1.01"/>
+  										</DoubleAnimationUsingKeyFrames>
+  										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
+  											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.03"/>
+  											<SplineDoubleKeyFrame KeySpline="0,0,0.148,0.933" KeyTime="00:00:00.7500000" Value="1.01"/>
+  										</DoubleAnimationUsingKeyFrames>
+  									</Storyboard>
+  								</BeginStoryboard>
+  							</MultiTrigger.ExitActions>
+  							<MultiTrigger.EnterActions>
+  								<BeginStoryboard x:Name="ActivationTimeline_BeginStoryboard">
+  									<Storyboard>
+  										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
+  											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.01"/>
+  											<SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="1.03"/>
+  										</DoubleAnimationUsingKeyFrames>
+  										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="container" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)">
+  											<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.01"/>
+  											<SplineDoubleKeyFrame KeySpline="0,1,1,1" KeyTime="00:00:00.4500000" Value="1.03"/>
+  										</DoubleAnimationUsingKeyFrames>
+  									</Storyboard>
+  								</BeginStoryboard>
+  							</MultiTrigger.EnterActions>
+  						</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>
+  					</ControlTemplate.Triggers>
+  				</ControlTemplate>
+  			</Setter.Value>
+  		</Setter>
+  	</Style>
   </s:SurfaceWindow.Resources>
 
   <Grid x:Name="MainGrid" Width="1024" Height="768" >
@@ -69,7 +176,7 @@
   		<Rectangle Fill="{x:Null}" Stroke="#FFFFFFFF" x:Name="rect4"/>
   	</Grid>
   	<s:ScatterView x:Name="scaterview"  ContactChanged="scaterview_ContactChanged">
-  		<s:ScatterViewItem   Center="512,384" CanMove="True" CanRotate="False" CanScale="False" Background="{x:Null}" x:Name="ScatterViewItemPivot" ContactChanged="ScatterViewItemPivot_ContactChanged" >
+  		<s:ScatterViewItem   Center="512,384" CanMove="True" CanRotate="False" CanScale="False" Background="{x:Null}" x:Name="ScatterViewItemPivot" ContactChanged="ScatterViewItemPivot_ContactChanged" Style="{DynamicResource FingersDance.Control.ScatterView}" BorderBrush="{x:Null}" Foreground="{x:Null}" >
   			<FingersDance_Control_Pivot:UserControlPivot x:Name="UserControlPivot" EH_SurfaceButtonPlayer1_ContactDown="UserControlPivot_EH_SurfaceButtonPlayer1_ContactDown" EH_SurfaceButtonPlayer2_ContactDown="UserControlPivot_EH_SurfaceButtonPlayer2_ContactDown" EH_SurfaceButtonPlayer3_ContactDown="UserControlPivot_EH_SurfaceButtonPlayer3_ContactDown" EH_SurfaceButtonPlayer4_ContactDown="UserControlPivot_EH_SurfaceButtonPlayer4_ContactDown"/>
   		</s:ScatterViewItem>
   	</s:ScatterView>