Merge from tip
authorymh
Wed, 16 Sep 2009 09:07:27 +0200
changeset 68 5f547156bda6
parent 67 70cca06f0a32 (current diff)
parent 66 3de4c1346bf4 (diff)
child 69 a4c44555f205
Merge from tip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/FingersDance.Control.Menu/CustomSurfaceButton.cs	Wed Sep 16 09:07:27 2009 +0200
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Surface;
+using Microsoft.Surface.Presentation;
+using Microsoft.Surface.Presentation.Controls;
+
+namespace FingersDance.Control.Menu
+{
+    public class CustomSurfaceButton:SurfaceButton
+    {
+        string _Action = "";
+        string _Ressource = "";
+
+        public string Action
+        {
+            get { return _Action; }
+            set { _Action = value; }
+        }
+
+        public string Ressource
+        {
+            get { return _Ressource; }
+            set { _Ressource = value; }
+        }
+
+        public CustomSurfaceButton()
+        {
+            this.ContactDown += GenerateAction;
+            this.Click += GenerateAction;
+        }
+
+        private void GenerateAction(Object sender, EventArgs Event)
+        {
+            try
+            {
+                ActionFactory.ActionGenerator AG = (new ActionFactory.ActionFactory()).GetGenerator();
+                FingersDance.Actions.ActionBase action = AG.GetAction("Action" + ((CustomSurfaceButton)sender).Content, null);
+                if (action != null)
+                {
+                    //action.Execute();
+                    //this.debug.addToList(action.GetType().ToString());
+                }
+            }
+            catch (Exception e) { }
+        }
+    }
+}
--- a/src/FingersDance.Control.Menu/FingersDance.Control.Menu.csproj	Wed Sep 16 08:34:32 2009 +0200
+++ b/src/FingersDance.Control.Menu/FingersDance.Control.Menu.csproj	Wed Sep 16 09:07:27 2009 +0200
@@ -88,6 +88,7 @@
     </Compile>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CustomSurfaceButton.cs" />
     <Compile Include="Item.cs" />
     <Compile Include="Menu.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
--- a/src/FingersDance.Control.Menu/Item.cs	Wed Sep 16 08:34:32 2009 +0200
+++ b/src/FingersDance.Control.Menu/Item.cs	Wed Sep 16 09:07:27 2009 +0200
@@ -11,5 +11,6 @@
         public List<Item> Items = new List<Item>();
         public string Name = "";
         public string Action = "";
+        public string Ressource = "";
     }
 }
--- a/src/FingersDance.Control.Menu/UserControlMenu.xaml	Wed Sep 16 08:34:32 2009 +0200
+++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml	Wed Sep 16 09:07:27 2009 +0200
@@ -3,24 +3,472 @@
 	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
 	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:Custom="http://schemas.microsoft.com/surface/2008"
 	mc:Ignorable="d"
 	x:Class="FingersDance.Control.Menu.UserControlMenu"
 	x:Name="UserControl"
-	Width="245" Height="Auto" xmlns:Custom="http://schemas.microsoft.com/surface/2008">
+	Width="245" Height="Auto" xmlns:Microsoft_Surface_Presentation_Generic="clr-namespace:Microsoft.Surface.Presentation.Generic;assembly=Microsoft.Surface.Presentation.Generic">
 
-    <StackPanel x:Name="LayoutRoot" Width="Auto" Height="Auto">
-        <StackPanel.Background>
-            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
-                <GradientStop Color="#FF000000" Offset="0"/>
-                <GradientStop Color="#FF444444" Offset="0.991"/>
-                <GradientStop Color="#FF757575" Offset="0.906"/>
-                <GradientStop Color="#FF414141" Offset="0.772"/>
-            </LinearGradientBrush>
-        </StackPanel.Background>
+    <UserControl.Resources>
+        <Style x:Key="FingersDanceAnnotationButtonNiveau1" TargetType="{x:Type Custom:SurfaceButton}">
+            <Style.BasedOn>
+                <Style TargetType="{x:Type ButtonBase}">
+                    <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="FontFamily" Value="Segoe UI"/>
+                    <Setter Property="FontSize" Value="14"/>
+                    <Setter Property="Foreground" Value="#DEE2E6"/>
+                    <Setter Property="Background" Value="#33A4B4BD"/>
+                    <Setter Property="BorderBrush">
+                        <Setter.Value>
+                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                                <GradientStop Color="#7FFFFFFF" Offset="0"/>
+                                <GradientStop Color="#0CFFFFFF" Offset="1"/>
+                            </LinearGradientBrush>
+                        </Setter.Value>
+                    </Setter>
+                    <Setter Property="BorderThickness" Value="1,1,1,1"/>
+                    <Setter Property="HorizontalContentAlignment" Value="Left"/>
+                    <Setter Property="VerticalContentAlignment" Value="Center"/>
+                    <Setter Property="Padding" Value="15,6,15,6"/>
+                    <Setter Property="IsTabStop" Value="False"/>
+                    <Setter Property="Focusable" Value="False"/>
+                    <Setter Property="MinWidth" Value="30"/>
+                    <Setter Property="MinHeight" Value="30"/>
+                    <Setter Property="Template">
+                        <Setter.Value>
+                            <ControlTemplate TargetType="{x:Type ButtonBase}">
+                                <ControlTemplate.Resources>
+                                    <Storyboard x:Key="Press">
+                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                            <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                            <SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3,-3,-3,-3"/>
+                                        </ThicknessAnimationUsingKeyFrames>
+                                    </Storyboard>
+                                    <Storyboard x:Key="Release">
+                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
+                                            <SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                            <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
+                                            <SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1,1,1,1"/>
+                                        </ThicknessAnimationUsingKeyFrames>
+                                    </Storyboard>
+                                </ControlTemplate.Resources>
+                                <Grid SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="Grid">
+                                    <Border Margin="1,1,1,0" x:Name="Shadow" BorderBrush="{x:Null}" BorderThickness="0,0,0,1" CornerRadius="6,6,6,6" Padding="1,1,1,1"/>
+                                    <Rectangle Stroke="{x:Null}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="1,1,1,1" x:Name="Base" StrokeThickness="1" RadiusX="5" RadiusY="5"/>
+                                    <Rectangle Opacity="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2,2,2,2" x:Name="RenderOverlay" StrokeThickness="1" RadiusX="4" RadiusY="4"/>
+                                    <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome Opacity="0" Margin="1,1,1,1" x:Name="Glow" Color="#FFFFFFFF" CornerRadius="4,4,4,4"/>
+                                    <ContentPresenter OpacityMask="#FFB0A4A4" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="Content" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}">
+                                        <ContentPresenter.RenderTransform>
+                                            <TranslateTransform X="0" Y="-1"/>
+                                        </ContentPresenter.RenderTransform>
+                                    </ContentPresenter>
+                                </Grid>
+                                <ControlTemplate.Triggers>
+                                    <Trigger Property="IsPressed" Value="True">
+                                        <Trigger.EnterActions>
+                                            <BeginStoryboard>
+                                                <Storyboard>
+                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                                        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
+                                                    </DoubleAnimationUsingKeyFrames>
+                                                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                                        <SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3,-3,-3,-3"/>
+                                                    </ThicknessAnimationUsingKeyFrames>
+                                                </Storyboard>
+                                            </BeginStoryboard>
+                                        </Trigger.EnterActions>
+                                        <Trigger.ExitActions>
+                                            <BeginStoryboard>
+                                                <Storyboard>
+                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
+                                                        <SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/>
+                                                    </DoubleAnimationUsingKeyFrames>
+                                                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                                        <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
+                                                        <SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1,1,1,1"/>
+                                                    </ThicknessAnimationUsingKeyFrames>
+                                                </Storyboard>
+                                            </BeginStoryboard>
+                                        </Trigger.ExitActions>
+                                    </Trigger>
+                                    <Trigger Property="IsEnabled" Value="True"/>
+                                    <Trigger Property="IsEnabled" Value="False">
+                                        <Setter Property="Fill" TargetName="RenderOverlay" Value="#0CFFFFFF"/>
+                                        <Setter Property="Stroke" TargetName="RenderOverlay" Value="#33FFFFFF"/>
+                                        <Setter Property="Stroke" TargetName="Base" Value="#33000000"/>
+                                        <Setter Property="BorderBrush" TargetName="Shadow" Value="#00000000"/>
+                                        <Setter Property="Foreground" Value="#A5333333"/>
+                                        <Setter Property="Background" Value="#00FFFFFF"/>
+                                    </Trigger>
+                                </ControlTemplate.Triggers>
+                            </ControlTemplate>
+                        </Setter.Value>
+                    </Setter>
+                </Style>
+            </Style.BasedOn>
+        </Style>
+        <Style x:Key="FingersDanceAnnotationButtonNiveau2" TargetType="{x:Type Custom:SurfaceButton}">
+            <Style.BasedOn>
+                <Style TargetType="{x:Type ButtonBase}">
+                    <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="FontFamily" Value="Segoe UI"/>
+                    <Setter Property="FontSize" Value="12"/>
+                    <Setter Property="Foreground" Value="#FFFFFF"/>
+                    <Setter Property="Background" Value="#33A4B4BD"/>
+                    <Setter Property="BorderBrush">
+                        <Setter.Value>
+                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                                <GradientStop Color="#7FFFFFFF" Offset="0"/>
+                                <GradientStop Color="#0CFFFFFF" Offset="1"/>
+                            </LinearGradientBrush>
+                        </Setter.Value>
+                    </Setter>
+                    <Setter Property="BorderThickness" Value="1,1,1,1"/>
+                    <Setter Property="HorizontalContentAlignment" Value="Left"/>
+                    <Setter Property="VerticalContentAlignment" Value="Center"/>
+                    <Setter Property="Padding" Value="30,6,15,6"/>
+                    <Setter Property="IsTabStop" Value="False"/>
+                    <Setter Property="Focusable" Value="False"/>
+                    <Setter Property="MinWidth" Value="30"/>
+                    <Setter Property="MinHeight" Value="30"/>
+                    <Setter Property="Template">
+                        <Setter.Value>
+                            <ControlTemplate TargetType="{x:Type ButtonBase}">
+                                <ControlTemplate.Resources>
+                                    <Storyboard x:Key="Press">
+                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                            <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                            <SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3,-3,-3,-3"/>
+                                        </ThicknessAnimationUsingKeyFrames>
+                                    </Storyboard>
+                                    <Storyboard x:Key="Release">
+                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
+                                            <SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                            <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
+                                            <SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1,1,1,1"/>
+                                        </ThicknessAnimationUsingKeyFrames>
+                                    </Storyboard>
+                                </ControlTemplate.Resources>
+                                <Grid SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="Grid">
+                                    <Border Margin="1,1,1,0" x:Name="Shadow" BorderBrush="{x:Null}" BorderThickness="0,0,0,1" CornerRadius="6,6,6,6" Padding="1,1,1,1"/>
+                                    <Rectangle Stroke="{x:Null}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="1,1,1,1" x:Name="Base" StrokeThickness="1" RadiusX="5" RadiusY="5"/>
+                                    <Rectangle Fill="{x:Null}" Opacity="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2,2,2,2" x:Name="RenderOverlay" StrokeThickness="1" RadiusX="4" RadiusY="4"/>
+                                    <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome Opacity="0" Margin="1,1,1,1" x:Name="Glow" Color="#FFFFFFFF" CornerRadius="4,4,4,4"/>
+                                    <ContentPresenter RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="Content" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}">
+                                        <ContentPresenter.RenderTransform>
+                                            <TranslateTransform X="0" Y="-1"/>
+                                        </ContentPresenter.RenderTransform>
+                                    </ContentPresenter>
+                                </Grid>
+                                <ControlTemplate.Triggers>
+                                    <Trigger Property="IsPressed" Value="True">
+                                        <Trigger.EnterActions>
+                                            <BeginStoryboard>
+                                                <Storyboard>
+                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                                        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
+                                                    </DoubleAnimationUsingKeyFrames>
+                                                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                                        <SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3,-3,-3,-3"/>
+                                                    </ThicknessAnimationUsingKeyFrames>
+                                                </Storyboard>
+                                            </BeginStoryboard>
+                                        </Trigger.EnterActions>
+                                        <Trigger.ExitActions>
+                                            <BeginStoryboard>
+                                                <Storyboard>
+                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
+                                                        <SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/>
+                                                    </DoubleAnimationUsingKeyFrames>
+                                                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                                        <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
+                                                        <SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1,1,1,1"/>
+                                                    </ThicknessAnimationUsingKeyFrames>
+                                                </Storyboard>
+                                            </BeginStoryboard>
+                                        </Trigger.ExitActions>
+                                    </Trigger>
+                                    <Trigger Property="IsEnabled" Value="True"/>
+                                    <Trigger Property="IsEnabled" Value="False">
+                                        <Setter Property="Fill" TargetName="RenderOverlay" Value="#0CFFFFFF"/>
+                                        <Setter Property="Stroke" TargetName="RenderOverlay" Value="#33FFFFFF"/>
+                                        <Setter Property="Stroke" TargetName="Base" Value="#33000000"/>
+                                        <Setter Property="BorderBrush" TargetName="Shadow" Value="#00000000"/>
+                                        <Setter Property="Foreground" Value="#A5333333"/>
+                                        <Setter Property="Background" Value="#00FFFFFF"/>
+                                    </Trigger>
+                                </ControlTemplate.Triggers>
+                            </ControlTemplate>
+                        </Setter.Value>
+                    </Setter>
+                </Style>
+            </Style.BasedOn>
+        </Style>
+        <Style x:Key="FingersDanceAnnotationButtonNiveau3" TargetType="{x:Type Custom:SurfaceButton}">
+            <Style.BasedOn>
+                <Style TargetType="{x:Type ButtonBase}">
+                    <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="FontFamily" Value="Segoe UI"/>
+                    <Setter Property="FontSize" Value="11"/>
+                    <Setter Property="Foreground" Value="#949483"/>
+                    <Setter Property="Background" Value="#33A4B4BD"/>
+                    <Setter Property="BorderBrush">
+                        <Setter.Value>
+                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                                <GradientStop Color="#7FFFFFFF" Offset="0"/>
+                                <GradientStop Color="#0CFFFFFF" Offset="1"/>
+                            </LinearGradientBrush>
+                        </Setter.Value>
+                    </Setter>
+                    <Setter Property="BorderThickness" Value="1,1,1,1"/>
+                    <Setter Property="HorizontalContentAlignment" Value="Left"/>
+                    <Setter Property="VerticalContentAlignment" Value="Center"/>
+                    <Setter Property="Padding" Value="45,6,15,6"/>
+                    <Setter Property="IsTabStop" Value="False"/>
+                    <Setter Property="Focusable" Value="False"/>
+                    <Setter Property="MinWidth" Value="30"/>
+                    <Setter Property="MinHeight" Value="30"/>
+                    <Setter Property="Template">
+                        <Setter.Value>
+                            <ControlTemplate TargetType="{x:Type ButtonBase}">
+                                <ControlTemplate.Resources>
+                                    <Storyboard x:Key="Press">
+                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                            <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                            <SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3,-3,-3,-3"/>
+                                        </ThicknessAnimationUsingKeyFrames>
+                                    </Storyboard>
+                                    <Storyboard x:Key="Release">
+                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
+                                            <SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                            <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
+                                            <SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1,1,1,1"/>
+                                        </ThicknessAnimationUsingKeyFrames>
+                                    </Storyboard>
+                                </ControlTemplate.Resources>
+                                <Grid SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="Grid">
+                                    <Border Margin="1,1,1,0" x:Name="Shadow" BorderThickness="0,0,0,1" CornerRadius="6,6,6,6" Padding="1,1,1,1"/>
+                                    <Rectangle Stroke="{x:Null}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="1,1,1,1" x:Name="Base" StrokeThickness="1" RadiusX="5" RadiusY="5"/>
+                                    <Rectangle Fill="{x:Null}" Opacity="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2,2,2,2" x:Name="RenderOverlay" StrokeThickness="1" RadiusX="4" RadiusY="4"/>
+                                    <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome Opacity="0" Margin="1,1,1,1" x:Name="Glow" Color="#FFFFFFFF" CornerRadius="4,4,4,4"/>
+                                    <ContentPresenter OpacityMask="{x:Null}" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="Content" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}">
+                                        <ContentPresenter.RenderTransform>
+                                            <TranslateTransform X="0" Y="-1"/>
+                                        </ContentPresenter.RenderTransform>
+                                    </ContentPresenter>
+                                </Grid>
+                                <ControlTemplate.Triggers>
+                                    <Trigger Property="IsPressed" Value="True">
+                                        <Trigger.EnterActions>
+                                            <BeginStoryboard>
+                                                <Storyboard>
+                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                                        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
+                                                    </DoubleAnimationUsingKeyFrames>
+                                                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                                        <SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3,-3,-3,-3"/>
+                                                    </ThicknessAnimationUsingKeyFrames>
+                                                </Storyboard>
+                                            </BeginStoryboard>
+                                        </Trigger.EnterActions>
+                                        <Trigger.ExitActions>
+                                            <BeginStoryboard>
+                                                <Storyboard>
+                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
+                                                        <SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/>
+                                                    </DoubleAnimationUsingKeyFrames>
+                                                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                                        <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
+                                                        <SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1,1,1,1"/>
+                                                    </ThicknessAnimationUsingKeyFrames>
+                                                </Storyboard>
+                                            </BeginStoryboard>
+                                        </Trigger.ExitActions>
+                                    </Trigger>
+                                    <Trigger Property="IsEnabled" Value="True"/>
+                                    <Trigger Property="IsEnabled" Value="False">
+                                        <Setter Property="Fill" TargetName="RenderOverlay" Value="#0CFFFFFF"/>
+                                        <Setter Property="Stroke" TargetName="RenderOverlay" Value="#33FFFFFF"/>
+                                        <Setter Property="Stroke" TargetName="Base" Value="#33000000"/>
+                                        <Setter Property="BorderBrush" TargetName="Shadow" Value="#00000000"/>
+                                        <Setter Property="Foreground" Value="#A5333333"/>
+                                        <Setter Property="Background" Value="#00FFFFFF"/>
+                                    </Trigger>
+                                </ControlTemplate.Triggers>
+                            </ControlTemplate>
+                        </Setter.Value>
+                    </Setter>
+                </Style>
+            </Style.BasedOn>
+        </Style>
+        <Style x:Key="FingersDanceAnnotationButtonNiveau4" TargetType="{x:Type Custom:SurfaceButton}">
+            <Style.BasedOn>
+                <Style TargetType="{x:Type ButtonBase}">
+                    <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="FontFamily" Value="Segoe UI"/>
+                    <Setter Property="FontSize" Value="10"/>
+                    <Setter Property="Foreground" Value="#50B7DC"/>
+                    <Setter Property="Background" Value="#33A4B4BD"/>
+                    <Setter Property="BorderBrush">
+                        <Setter.Value>
+                            <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                                <GradientStop Color="#7FFFFFFF" Offset="0"/>
+                                <GradientStop Color="#0CFFFFFF" Offset="1"/>
+                            </LinearGradientBrush>
+                        </Setter.Value>
+                    </Setter>
+                    <Setter Property="BorderThickness" Value="1,1,1,1"/>
+                    <Setter Property="HorizontalContentAlignment" Value="Left"/>
+                    <Setter Property="VerticalContentAlignment" Value="Center"/>
+                    <Setter Property="Padding" Value="60,6,15,6"/>
+                    <Setter Property="IsTabStop" Value="False"/>
+                    <Setter Property="Focusable" Value="False"/>
+                    <Setter Property="MinWidth" Value="30"/>
+                    <Setter Property="MinHeight" Value="30"/>
+                    <Setter Property="Template">
+                        <Setter.Value>
+                            <ControlTemplate TargetType="{x:Type ButtonBase}">
+                                <ControlTemplate.Resources>
+                                    <Storyboard x:Key="Press">
+                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                            <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                            <SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3,-3,-3,-3"/>
+                                        </ThicknessAnimationUsingKeyFrames>
+                                    </Storyboard>
+                                    <Storyboard x:Key="Release">
+                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
+                                            <SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/>
+                                        </DoubleAnimationUsingKeyFrames>
+                                        <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                            <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
+                                            <SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1,1,1,1"/>
+                                        </ThicknessAnimationUsingKeyFrames>
+                                    </Storyboard>
+                                </ControlTemplate.Resources>
+                                <Grid SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="Grid">
+                                    <Border Margin="1,1,1,0" x:Name="Shadow" BorderBrush="{x:Null}" BorderThickness="0,0,0,1" CornerRadius="6,6,6,6" Padding="1,1,1,1"/>
+                                    <Rectangle SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="1,1,1,1" x:Name="Base" StrokeThickness="1" RadiusX="5" RadiusY="5" Stroke="{x:Null}"/>
+                                    <Rectangle Opacity="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="2,2,2,2" x:Name="RenderOverlay" StrokeThickness="1" RadiusX="4" RadiusY="4" Fill="{x:Null}"/>
+                                    <Microsoft_Surface_Presentation_Generic:SurfaceShadowChrome Opacity="0" Margin="1,1,1,1" x:Name="Glow" Color="#FFFFFFFF" CornerRadius="4,4,4,4"/>
+                                    <ContentPresenter RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="Content" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" OpacityMask="{x:Null}">
+                                        <ContentPresenter.RenderTransform>
+                                            <TranslateTransform X="0" Y="-1"/>
+                                        </ContentPresenter.RenderTransform>
+                                    </ContentPresenter>
+                                </Grid>
+                                <ControlTemplate.Triggers>
+                                    <Trigger Property="IsPressed" Value="True">
+                                        <Trigger.EnterActions>
+                                            <BeginStoryboard>
+                                                <Storyboard>
+                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                                        <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
+                                                    </DoubleAnimationUsingKeyFrames>
+                                                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                                        <SplineThicknessKeyFrame KeyTime="00:00:00.1000000" Value="-3,-3,-3,-3"/>
+                                                    </ThicknessAnimationUsingKeyFrames>
+                                                </Storyboard>
+                                            </BeginStoryboard>
+                                        </Trigger.EnterActions>
+                                        <Trigger.ExitActions>
+                                            <BeginStoryboard>
+                                                <Storyboard>
+                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(UIElement.Opacity)">
+                                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
+                                                        <SplineDoubleKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="0"/>
+                                                    </DoubleAnimationUsingKeyFrames>
+                                                    <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Glow" Storyboard.TargetProperty="(FrameworkElement.Margin)">
+                                                        <SplineThicknessKeyFrame KeyTime="00:00:00" Value="-3,-3,-3,-3"/>
+                                                        <SplineThicknessKeyFrame KeySpline="0.5,0.5,0.5,1" KeyTime="00:00:00.5000000" Value="1,1,1,1"/>
+                                                    </ThicknessAnimationUsingKeyFrames>
+                                                </Storyboard>
+                                            </BeginStoryboard>
+                                        </Trigger.ExitActions>
+                                    </Trigger>
+                                    <Trigger Property="IsEnabled" Value="True"/>
+                                    <Trigger Property="IsEnabled" Value="False">
+                                        <Setter Property="Fill" TargetName="RenderOverlay" Value="#0CFFFFFF"/>
+                                        <Setter Property="Stroke" TargetName="RenderOverlay" Value="#33FFFFFF"/>
+                                        <Setter Property="Stroke" TargetName="Base" Value="#33000000"/>
+                                        <Setter Property="BorderBrush" TargetName="Shadow" Value="#00000000"/>
+                                        <Setter Property="Foreground" Value="#A5333333"/>
+                                        <Setter Property="Background" Value="#00FFFFFF"/>
+                                    </Trigger>
+                                </ControlTemplate.Triggers>
+                            </ControlTemplate>
+                        </Setter.Value>
+                    </Setter>
+                </Style>
+            </Style.BasedOn>
+        </Style>
+    </UserControl.Resources>
 
-
-
-
+    <StackPanel x:Name="LayoutRoot" Width="Auto" Height="Auto" Background="{x:Null}">
 
     </StackPanel>
 </UserControl>
\ No newline at end of file
--- a/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs	Wed Sep 16 08:34:32 2009 +0200
+++ b/src/FingersDance.Control.Menu/UserControlMenu.xaml.cs	Wed Sep 16 09:07:27 2009 +0200
@@ -54,29 +54,28 @@
              try
              {
                  StackPanel MItem = new StackPanel();
-                 Microsoft.Surface.Presentation.Controls.SurfaceButton ItemButton = new Microsoft.Surface.Presentation.Controls.SurfaceButton();
+                 CustomSurfaceButton ItemButton = new CustomSurfaceButton();
                  ItemButton.Content = item.Name;
+                 ItemButton.Style = (Style)FindResource(item.Ressource);
                  if (item.Items.Count > 0)
                  {
                      ItemButton.ContactDown += ButtonMenu_ContactDown;
                      ItemButton.Click += ButtonMenu_ContactDown;
                      MItem.Children.Add(ItemButton);
                      StackPanel Temp = new StackPanel();
-                     Temp.Margin = new Thickness(15,0,0,0);
                      foreach (Item elt in item.Items)
                          try
                          {
                              Temp.Children.Add(CreateMenuItem(elt));
                          }
                          catch (Exception) { }
-                     Temp.Name = ItemButton.Content + "Panel";
+                     Temp.Name = ItemButton.Content.ToString().Replace(' ', '_') + "Panel";
                      Temp.Visibility = Visibility.Collapsed;
                      MItem.Children.Add(Temp);
                  }
                  else
                  {
-                     ItemButton.ContactDown += GenerateAction;
-                     ItemButton.Click += GenerateAction;
+                     ItemButton.Action = item.Action;
                      MItem.Children.Add(ItemButton);
                  }
                  return MItem;
@@ -87,27 +86,12 @@
              }
          }
 
-         private void GenerateAction(Object sender, RoutedEventArgs Event)
-         {
-             try
-             {
-                 ActionFactory.ActionGenerator AG = (new ActionFactory.ActionFactory()).GetGenerator();
-                 FingersDance.Actions.ActionBase action = AG.GetAction("Action" + ((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Content, null);
-                 if (action != null)
-                 {
-                     //action.Execute();
-                     //this.debug.addToList(action.GetType().ToString());
-                 }
-             }
-             catch (Exception e) { }
-         }
-
          private void ButtonMenu_ContactDown(object sender, RoutedEventArgs e)
          {
-             foreach (UIElement Child in ((Panel)((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Parent).Children)
+             foreach (UIElement Child in ((Panel)((CustomSurfaceButton)sender).Parent).Children)
                  try
                  {
-                     if (((StackPanel)Child).Name.Equals(((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Content + "Panel"))
+                     if (((StackPanel)Child).Name.Equals(((Microsoft.Surface.Presentation.Controls.SurfaceButton)sender).Content.ToString().Replace(' ', '_') + "Panel"))
                      {
                          if (((StackPanel)Child).Visibility == Visibility.Collapsed)
                          {
--- a/src/FingersDance.Control.Pivot/UserControlPivot.xaml.cs	Wed Sep 16 08:34:32 2009 +0200
+++ b/src/FingersDance.Control.Pivot/UserControlPivot.xaml.cs	Wed Sep 16 09:07:27 2009 +0200
@@ -20,7 +20,7 @@
 		public UserControlPivot()
 		{
 			this.InitializeComponent();
-
+            
 			// Insert code required on object creation below this point.
 		}
 
--- a/src/FingersDance/Resources/menu.xml	Wed Sep 16 08:34:32 2009 +0200
+++ b/src/FingersDance/Resources/menu.xml	Wed Sep 16 09:07:27 2009 +0200
@@ -8,66 +8,86 @@
 					<Name>Cinematographique</Name>
 					<Items>
 						<Item>
-							<Name>MouvCam1</Name>
-							<Items/>
-							<Action>MouvCam1</Action>
+							<Name>Mouv Camera</Name>
+							<Items>
+								<Item>
+									<Name>MouvCam1</Name>
+									<Items/>
+									<Ressource>FingersDanceAnnotationButtonNiveau4</Ressource>
+									<Action>MouvCam1</Action>
+								</Item>
+								<Item>
+									<Name>MouvCam2</Name>
+									<Items/>
+									<Ressource>FingersDanceAnnotationButtonNiveau4</Ressource>
+									<Action>MouvCam2</Action>
+								</Item>
+							</Items>
+							<Ressource>FingersDanceAnnotationButtonNiveau3</Ressource>
+							<Action>MouvCam</Action>
 						</Item>
 						<Item>
-							<Name>MouvCam2</Name>
-							<Items/>
-							<Action>MouvCam2</Action>
+							<Name>Axe de Camera</Name>
+							<Items>
+								<Item>
+									<Name>Axe camera1</Name>
+									<Items/>
+									<Ressource>FingersDanceAnnotationButtonNiveau4</Ressource>
+									<Action>Axecamera1</Action>
+								</Item>
+								<Item>
+									<Name>Axe camera2</Name>
+									<Items/>
+									<Ressource>FingersDanceAnnotationButtonNiveau4</Ressource>
+									<Action>Axecamera2</Action>
+								</Item>
+								<Item>
+									<Name>Axe camera3</Name>
+									<Items/>
+									<Ressource>FingersDanceAnnotationButtonNiveau4</Ressource>
+									<Action>Axecamera3</Action>
+								</Item>
+								<Item>
+									<Name>Axe camera4</Name>
+									<Items/>
+									<Ressource>FingersDanceAnnotationButtonNiveau4</Ressource>
+									<Action>Axecamera4</Action>
+								</Item>
+							</Items>
+							<Ressource>FingersDanceAnnotationButtonNiveau3</Ressource>
+							<Action>Axecamera</Action>
 						</Item>
 					</Items>
+					<Ressource>FingersDanceAnnotationButtonNiveau2</Ressource>
 					<Action>Cinematographique</Action>
-				</Item>
-				<Item>
-					<Name>Camera</Name>
-					<Items>
-						<Item>
-							<Name>Axe camera1</Name>
-							<Items/>
-							<Action>Axe camera1</Action>
-						</Item>
-						<Item>
-							<Name>Axe camera2</Name>
-							<Items/>
-							<Action>Axe camera2</Action>
-						</Item>
-						<Item>
-							<Name>Axe camera3</Name>
-							<Items/>
-							<Action>Axe camera3</Action>
-						</Item>
-						<Item>
-							<Name>Axe camera4</Name>
-							<Items/>
-							<Action>Axe camera4</Action>
-						</Item>
-					</Items>
-					<Action>Camera</Action>
-				</Item>
+				</Item>						
 				<Item>
 					<Name>Choregraphique</Name>
 					<Items>
 						<Item>
 							<Name>ChildChore1</Name>
 							<Items/>
+							<Ressource>FingersDanceAnnotationButtonNiveau3</Ressource>
 							<Action>ChildChore1</Action>
 						</Item>
 						<Item>
 							<Name>ChildChore2</Name>
 							<Items/>
+							<Ressource>FingersDanceAnnotationButtonNiveau3</Ressource>
 							<Action>ChildChore2</Action>
 						</Item>
 					</Items>
+					<Ressource>FingersDanceAnnotationButtonNiveau2</Ressource>
 					<Action>Choregraphique</Action>
 				</Item>
 			</Items>
+			<Ressource>FingersDanceAnnotationButtonNiveau1</Ressource>
 			<Action>Annotation</Action>
 		</Item>
 		<Item>
 			<Name>ButtonRecherche</Name>
 			<Items/>
+			<Ressource>FingersDanceAnnotationButtonNiveau1</Ressource>
 			<Action>ButtonRecherche</Action>
 		</Item>
 	</Items>