author | ARIAS Santiago |
Mon, 26 Oct 2009 08:36:15 +0100 | |
changeset 173 | e99fe78cd168 |
parent 172 | e408e158c1a2 |
child 174 | 45c9e55fcf23 |
permissions | -rw-r--r-- |
3 | 1 |
<UserControl |
2 |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
3 |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
4 |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
5 |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
6 |
mc:Ignorable="d" |
|
92 | 7 |
xmlns:Custom="http://schemas.microsoft.com/surface/2008" xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic" |
173
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
8 |
xmlns:FingersDance_Control_Player="clr-namespace:FingersDance.Control.Player" |
3 | 9 |
x:Class="FingersDance.Control.Player.UserControlPlayer" |
143 | 10 |
x:Name="UserControl" AllowDrop="True" Custom:SurfaceDragDrop.DragOver="Play_Pause_area_DragOver" Custom:SurfaceDragDrop.DragEnter="Play_Pause_area_DragEnter" Custom:SurfaceDragDrop.DragLeave="Play_Pause_area_DragLeave" Custom:SurfaceDragDrop.Drop="Play_Pause_area_Drop" |
173
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
11 |
Width="560" Height="400" xmlns:GestureControl="clr-namespace:GestureControl;assembly=GestureControl"> |
4 | 12 |
<UserControl.Resources> |
13 |
<Storyboard x:Key="OnClick1"/> |
|
92 | 14 |
<Style x:Key="FingersDance.Control.PlayerButton" TargetType="{x:Type Custom:SurfaceButton}"> |
15 |
<Style.BasedOn> |
|
16 |
<Style TargetType="{x:Type ButtonBase}"> |
|
17 |
<Setter Property="SnapsToDevicePixels" Value="True"/> |
|
18 |
<Setter Property="FocusVisualStyle"> |
|
19 |
<Setter.Value> |
|
20 |
<Style> |
|
21 |
<Setter Property="Control.Template"> |
|
22 |
<Setter.Value> |
|
23 |
<ControlTemplate/> |
|
24 |
</Setter.Value> |
|
25 |
</Setter> |
|
26 |
</Style> |
|
27 |
</Setter.Value> |
|
28 |
</Setter> |
|
29 |
<Setter Property="FontFamily" Value="Segoe UI"/> |
|
30 |
<Setter Property="FontSize" Value="10"/> |
|
31 |
<Setter Property="Foreground" Value="Black"/> |
|
32 |
<Setter Property="Background" Value="#33A4B4BD"/> |
|
33 |
<Setter Property="BorderBrush"> |
|
34 |
<Setter.Value> |
|
35 |
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0"> |
|
36 |
<GradientStop Color="#7FFFFFFF" Offset="0"/> |
|
37 |
<GradientStop Color="#0CFFFFFF" Offset="1"/> |
|
38 |
</LinearGradientBrush> |
|
39 |
</Setter.Value> |
|
40 |
</Setter> |
|
41 |
<Setter Property="BorderThickness" Value="1"/> |
|
42 |
<Setter Property="HorizontalContentAlignment" Value="Center"/> |
|
43 |
<Setter Property="VerticalContentAlignment" Value="Center"/> |
|
44 |
<Setter Property="Padding" Value="15,6"/> |
|
45 |
<Setter Property="IsTabStop" Value="False"/> |
|
46 |
<Setter Property="Focusable" Value="False"/> |
|
47 |
<Setter Property="MinWidth" Value="30"/> |
|
48 |
<Setter Property="MinHeight" Value="30"/> |
|
49 |
<Setter Property="Template"> |
|
50 |
<Setter.Value> |
|
51 |
<ControlTemplate TargetType="{x:Type ButtonBase}"> |
|
52 |
<ControlTemplate.Resources> |
|
53 |
<Storyboard x:Key="Press"> |
|
54 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)"> |
|
55 |
<SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/> |
|
56 |
</DoubleAnimationUsingKeyFrames> |
|
57 |
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)"> |
|
58 |
<SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3"/> |
|
59 |
</ThicknessAnimationUsingKeyFrames> |
|
60 |
</Storyboard> |
|
61 |
<Storyboard x:Key="Release"> |
|
62 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)"> |
|
63 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> |
|
64 |
<SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/> |
|
65 |
</DoubleAnimationUsingKeyFrames> |
|
66 |
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)"> |
|
67 |
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3"/> |
|
68 |
<SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1"/> |
|
69 |
</ThicknessAnimationUsingKeyFrames> |
|
70 |
</Storyboard> |
|
71 |
</ControlTemplate.Resources> |
|
72 |
<Grid x:Name="Grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"> |
|
73 |
<Border x:Name="Shadow" Margin="1,1,1,0" BorderBrush="{x:Null}" BorderThickness="0,0,0,1" CornerRadius="6" Padding="1"/> |
|
74 |
<Rectangle x:Name="Base" Fill="{TemplateBinding Background}" StrokeThickness="1" RadiusX="5" RadiusY="5" Margin="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Stroke="{x:Null}"/> |
|
75 |
<Rectangle x:Name="RenderOverlay" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="4" RadiusY="4" Margin="2" Opacity="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Fill="{x:Null}"/> |
|
76 |
<Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome x:Name="Glow" Margin="1" Opacity="0" Color="White" CornerRadius="4"/> |
|
77 |
<ContentPresenter x:Name="Content" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"> |
|
78 |
<ContentPresenter.RenderTransform> |
|
79 |
<TranslateTransform X="0" Y="-1"/> |
|
80 |
</ContentPresenter.RenderTransform> |
|
81 |
</ContentPresenter> |
|
82 |
</Grid> |
|
83 |
<ControlTemplate.Triggers> |
|
84 |
<Trigger Property="IsPressed" Value="True"> |
|
85 |
<Trigger.EnterActions> |
|
86 |
<BeginStoryboard> |
|
87 |
<Storyboard> |
|
88 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)"> |
|
89 |
<SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/> |
|
90 |
</DoubleAnimationUsingKeyFrames> |
|
91 |
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)"> |
|
92 |
<SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3"/> |
|
93 |
</ThicknessAnimationUsingKeyFrames> |
|
94 |
</Storyboard> |
|
95 |
</BeginStoryboard> |
|
96 |
</Trigger.EnterActions> |
|
97 |
<Trigger.ExitActions> |
|
98 |
<BeginStoryboard> |
|
99 |
<Storyboard> |
|
100 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)"> |
|
101 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> |
|
102 |
<SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/> |
|
103 |
</DoubleAnimationUsingKeyFrames> |
|
104 |
<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)"> |
|
105 |
<SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3"/> |
|
106 |
<SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1"/> |
|
107 |
</ThicknessAnimationUsingKeyFrames> |
|
108 |
</Storyboard> |
|
109 |
</BeginStoryboard> |
|
110 |
</Trigger.ExitActions> |
|
111 |
</Trigger> |
|
112 |
<Trigger Property="IsEnabled" Value="True"/> |
|
113 |
<Trigger Property="IsEnabled" Value="False"> |
|
114 |
<Setter Property="Fill" TargetName="RenderOverlay" Value="#0CFFFFFF"/> |
|
115 |
<Setter Property="Stroke" TargetName="RenderOverlay" Value="#33FFFFFF"/> |
|
116 |
<Setter Property="Stroke" TargetName="Base" Value="#33000000"/> |
|
117 |
<Setter Property="BorderBrush" TargetName="Shadow" Value="#00000000"/> |
|
118 |
<Setter Property="Foreground" Value="#A5333333"/> |
|
119 |
<Setter Property="Background" Value="Transparent"/> |
|
120 |
</Trigger> |
|
121 |
</ControlTemplate.Triggers> |
|
122 |
</ControlTemplate> |
|
123 |
</Setter.Value> |
|
124 |
</Setter> |
|
125 |
</Style> |
|
126 |
</Style.BasedOn> |
|
127 |
</Style> |
|
163 | 128 |
<Storyboard x:Key="Rect1Annotation"> |
129 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rect1" Storyboard.TargetProperty="(UIElement.Opacity)"> |
|
130 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> |
|
131 |
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1" KeySpline="0,0,0.5,1"/> |
|
132 |
<SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/> |
|
133 |
</DoubleAnimationUsingKeyFrames> |
|
134 |
</Storyboard> |
|
135 |
<Storyboard x:Key="Rect2Annotation"> |
|
136 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rect2" Storyboard.TargetProperty="(UIElement.Opacity)"> |
|
137 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> |
|
138 |
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1" KeySpline="0,0,0.5,1"/> |
|
139 |
<SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/> |
|
140 |
</DoubleAnimationUsingKeyFrames> |
|
141 |
</Storyboard> |
|
142 |
<Storyboard x:Key="Rect3Annotation"> |
|
143 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rect3" Storyboard.TargetProperty="(UIElement.Opacity)"> |
|
144 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> |
|
145 |
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/> |
|
146 |
<SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/> |
|
147 |
</DoubleAnimationUsingKeyFrames> |
|
148 |
</Storyboard> |
|
149 |
<Storyboard x:Key="Rect4Annotation"> |
|
150 |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rect4" Storyboard.TargetProperty="(UIElement.Opacity)"> |
|
151 |
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> |
|
152 |
<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1" KeySpline="0,0,0.5,1"/> |
|
153 |
<SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/> |
|
154 |
</DoubleAnimationUsingKeyFrames> |
|
155 |
</Storyboard> |
|
4 | 156 |
</UserControl.Resources> |
163 | 157 |
<UserControl.Triggers> |
158 |
<EventTrigger RoutedEvent="FrameworkElement.Loaded"> |
|
159 |
<BeginStoryboard Storyboard="{StaticResource Rect1Annotation}"/> |
|
160 |
<BeginStoryboard Storyboard="{StaticResource Rect2Annotation}"/> |
|
161 |
<BeginStoryboard Storyboard="{StaticResource Rect3Annotation}"/> |
|
162 |
<BeginStoryboard Storyboard="{StaticResource Rect4Annotation}"/> |
|
163 |
</EventTrigger> |
|
164 |
</UserControl.Triggers> |
|
170 | 165 |
<Grid x:Name="LayoutRoot" Width="{Binding Path=ActualWidth, ElementName=UserControl, Mode=Default}" Height="{Binding Path=ActualHeight, ElementName=UserControl, Mode=Default}" Background="{x:Null}"> |
166 |
<Viewbox Margin="0,0,0,0" Width="{Binding Path=ActualWidth, ElementName=UserControl, Mode=Default}" Height="{Binding Path=ActualHeight, ElementName=UserControl, Mode=Default}" Stretch="Uniform" AllowDrop="True"> |
|
143 | 167 |
<Grid Width="560" Height="400" HorizontalAlignment="Left" x:Name="GridPlayer"> |
170 | 168 |
<Grid.RowDefinitions> |
173
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
169 |
<RowDefinition Height="0.305*"/> |
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
170 |
<RowDefinition Height="0.593*"/> |
170 | 171 |
<RowDefinition Height="0.102*"/> |
172 |
</Grid.RowDefinitions> |
|
173 |
<Grid.ColumnDefinitions> |
|
174 |
<ColumnDefinition Width="0.912*"/> |
|
175 |
<ColumnDefinition Width="0.088*"/> |
|
176 |
</Grid.ColumnDefinitions> |
|
173
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
177 |
<FingersDance_Control_Player:UserControlInfoUser Margin="0,-0.498,0,11.298" x:Name="usercontrolInfoUser" Grid.ColumnSpan="1" Grid.Row="2" Height="30"/> |
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
178 |
<MediaElement x:Name="MediaElementVideo" MediaOpened="MediaElementVideo_MediaOpened" Stretch="Fill" ScrubbingEnabled="False" StretchDirection="Both" Grid.RowSpan="2" /> |
143 | 179 |
<Custom:SurfaceButton x:Name="Rewind_area" Content="" ContactDown="ButtonRewind_ContactDown" |
180 |
Click="ButtonRewind_Click" Foreground="{x:Null}" Background="#FFFFFFFF" BorderBrush="{x:Null}" |
|
173
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
181 |
Opacity="0" Style="{DynamicResource FingersDance.Control.PlayerButton}" HorizontalAlignment="Left" Width="72" Grid.RowSpan="1"/> |
143 | 182 |
<Custom:SurfaceButton x:Name="Fast_Forward_area" Content="" ContactDown="ButtonFastForward_ContactDown" Click="ButtonFastForward_Click" |
170 | 183 |
Foreground="{x:Null}" Background="#FFFFFFFF" BorderBrush="{x:Null}" Opacity="0" |
173
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
184 |
Style="{DynamicResource FingersDance.Control.PlayerButton}" HorizontalAlignment="Right" Width="72" Grid.RowSpan="1"/> |
143 | 185 |
<Custom:SurfaceButton x:Name="Play_Pause_area" ContactDown="ButtonPlayPause_ContactDown" Click="ButtonPlayPause_Click" Foreground="{x:Null}" |
173
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
186 |
Background="#FFFFFFFF" BorderBrush="{x:Null}" Style="{DynamicResource FingersDance.Control.PlayerButton}" Opacity="0" Margin="72,0,72,0" Grid.RowSpan="1"/> |
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
187 |
<StackPanel Opacity="1" Background="{x:Null}" x:Name="StackPanelAnnotation" Height="Auto" d:LayoutOverrides="Height" Margin="-1,77.8,0,0" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2"> |
163 | 188 |
<Rectangle x:Name="rect1" Width="50" Height="50" Fill="{x:Null}" Stroke="#FF000000"/> |
189 |
<Rectangle x:Name="rect2" Width="50" Height="50" Fill="{x:Null}" Stroke="#FF000000"/> |
|
190 |
<Rectangle x:Name="rect3" Width="50" Height="50" Fill="{x:Null}" Stroke="#FF000000"/> |
|
191 |
<Rectangle x:Name="rect4" Width="50" Height="50" Fill="{x:Null}" Stroke="#FF000000" VerticalAlignment="Bottom"/> |
|
143 | 192 |
</StackPanel> |
173
e99fe78cd168
Gesture Control Integration in the Control Player
ARIAS Santiago
parents:
172
diff
changeset
|
193 |
<GestureControl:GestureControl HorizontalAlignment="Stretch" x:Name="gestureControl" VerticalAlignment="Stretch" Content="" Grid.Row="1"/> |
143 | 194 |
</Grid> |
195 |
</Viewbox> |
|
196 |
</Grid> |
|
34 | 197 |
</UserControl> |