src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs
changeset 203 2948b34324bb
parent 196 e738cd9c1b99
child 207 6405d0b7d085
equal deleted inserted replaced
202:e15e7110ef6d 203:2948b34324bb
    16 
    16 
    17 using FingersDance.Data;
    17 using FingersDance.Data;
    18 using FingersDance.ViewModels;
    18 using FingersDance.ViewModels;
    19 using FingersDance.Views;
    19 using FingersDance.Views;
    20 using FingersDance.Control.Close;
    20 using FingersDance.Control.Close;
       
    21 using GestureControl;
    21 
    22 
    22 namespace FingersDance.Control.TimeLine
    23 namespace FingersDance.Control.TimeLine
    23 {
    24 {
    24 	public partial class UserControlTimeLine
    25 	public partial class UserControlTimeLine
    25     {
    26     {
   224             if(isplaying)
   225             if(isplaying)
   225                 slider.Style = FindResource("FingersDance.Control.Slider") as Style;
   226                 slider.Style = FindResource("FingersDance.Control.Slider") as Style;
   226             else
   227             else
   227                 slider.Style = FindResource("SurfaceSliderStylePause") as Style;
   228                 slider.Style = FindResource("SurfaceSliderStylePause") as Style;
   228         }
   229         }
       
   230 
   229         public Boolean isAnnotationAccepted(AnnotationViewModel avm)
   231         public Boolean isAnnotationAccepted(AnnotationViewModel avm)
   230         {
   232         {
   231             Boolean annotOk = true;
   233             Boolean annotOk = true;
   232             // We check if the annotation's begin and end timecodes allow a new annotation creation
   234             // We check if the annotation's begin and end timecodes allow a new annotation creation
   233             if (cut != null && AnnotWaiting == false)
   235             if (cut != null && AnnotWaiting == false)
   354                 }
   356                 }
   355                 //Raise Event to display Annotation in all Openned UserPanels
   357                 //Raise Event to display Annotation in all Openned UserPanels
   356                 if (annotOk)
   358                 if (annotOk)
   357                     OnSuccessAnnotation(this, new EventArgs());
   359                     OnSuccessAnnotation(this, new EventArgs());
   358             }
   360             }
       
   361         }
       
   362 
       
   363         
       
   364         public void UserControlPlayer_NewGestureRegognized(object sender, EventArgs e)
       
   365         {
       
   366             GestureRoutedEventArgs grea = (GestureRoutedEventArgs)e;
       
   367             Console.WriteLine("Timeline NewGestureRegognized " + grea.Gesture.Name + ", " + grea.Gesture.Start + ", " + grea.Gesture.End);
       
   368             addAnnotation(new AnnotationViewModel(new Annotation("temp",(float)grea.Gesture.Start, (float)(grea.Gesture.End-grea.Gesture.Start + 20), grea.Gesture.Name, CurrentColor), 0));
   359         }
   369         }
   360 
   370 
   361         private void listview_PreviewContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
   371         private void listview_PreviewContactDown(object sender, Microsoft.Surface.Presentation.ContactEventArgs e)
   362         {
   372         {
   363             FrameworkElement findSource = e.OriginalSource as FrameworkElement;
   373             FrameworkElement findSource = e.OriginalSource as FrameworkElement;