# HG changeset patch # User cavaliet # Date 1253185582 -7200 # Node ID 7ce946833eaea124bdb079d6d41ab5147c3f257c # Parent 31900a35e162f74c22f23935085be9c663a4e8b9 First step of data binding where we can add an annotation by clicking on the timeline diff -r 31900a35e162 -r 7ce946833eae src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml --- a/src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml Wed Sep 16 19:32:26 2009 +0200 +++ b/src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml Thu Sep 17 13:06:22 2009 +0200 @@ -11,7 +11,7 @@ - + diff -r 31900a35e162 -r 7ce946833eae src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml --- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml Wed Sep 16 19:32:26 2009 +0200 +++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml Thu Sep 17 13:06:22 2009 +0200 @@ -7,10 +7,12 @@ x:Class="FingersDance.Control.TimeLine.UserControlTimeLine" xmlns:vw="clr-namespace:FingersDance.Views;assembly=FingersDance.Views" x:Name="UserControl" - d:DesignWidth="383" xmlns:Custom="http://schemas.microsoft.com/surface/2008" Height="Auto" Background="{x:Null}" d:DesignHeight="33"> + d:DesignWidth="383" xmlns:Custom="http://schemas.microsoft.com/surface/2008" Background="{x:Null}" d:DesignHeight="33"> - - + + \ No newline at end of file diff -r 31900a35e162 -r 7ce946833eae src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs --- a/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Wed Sep 16 19:32:26 2009 +0200 +++ b/src/FingersDance.Control.TimeLine/UserControlTimeLine.xaml.cs Thu Sep 17 13:06:22 2009 +0200 @@ -30,6 +30,11 @@ public event EventHandler DragCompleted; public event EventHandler TimerTick; + private List annotList = new List(); + private float annotWidth = 40; + private CuttingViewModel cutvm; + private int numAnnot = 1; + #region Properties public SurfaceSlider Slider @@ -85,7 +90,7 @@ public UserControlTimeLine() - { + { this.InitializeComponent(); // Insert code required on object creation below this point. @@ -98,15 +103,24 @@ // TEMP FOR DATA BINDING - List annotList = new List(); + annotList = new List(); annotList.Add(new Annotation(0, 10, "Axe Cam 1")); - annotList.Add(new Annotation(10, 20, "Mvt Cam 2")); - annotList.Add(new Annotation(30, 40, "Saut 3")); + annotList.Add(new Annotation(20 - (1 * annotWidth), 30, "Mvt Cam 2")); + annotList.Add(new Annotation(50 - (2 * annotWidth), 60, "Saut 3")); + annotList.Add(new Annotation(100 - (3 * annotWidth), 20, "Saut 4")); + annotList.Add(new Annotation(120 - (4 * annotWidth), 50, "Saut 5")); Cutting cut = new Cutting("titre de cutting", annotList); - CuttingViewModel cutvm = new CuttingViewModel(cut); - tv.DataContext = cut; + cutvm = new CuttingViewModel(cut); + tv.DataContext = cutvm; - + numAnnot = 6; + slider_ContactTapGesture(this,null); + /* + cutvm.AnnotList.Add(new AnnotationViewModel(new Annotation(180 - (5 * annotWidth), 10, "6"))); + tv.DataContext = null; + tv.DataContext = cutvm; + numAnnot = 7; + */ } #region Timer @@ -172,5 +186,15 @@ DragCompleted(this, new EventArgs()); } + private void slider_ContactTapGesture(object sender, Microsoft.Surface.Presentation.ContactEventArgs e) + { + + cutvm.AnnotList.Add(new AnnotationViewModel(new Annotation(180+(numAnnot-6)*20 - ((numAnnot-1) * annotWidth), 10, numAnnot.ToString()))); + tv.DataContext = null; + tv.DataContext = cutvm; + numAnnot++; + } + + } } \ No newline at end of file diff -r 31900a35e162 -r 7ce946833eae src/FingersDance.Views/TimelineAnnotationView.xaml --- a/src/FingersDance.Views/TimelineAnnotationView.xaml Wed Sep 16 19:32:26 2009 +0200 +++ b/src/FingersDance.Views/TimelineAnnotationView.xaml Thu Sep 17 13:06:22 2009 +0200 @@ -8,12 +8,14 @@ x:Class="FingersDance.Views.TimelineAnnotationView" xmlns:vw="clr-namespace:FingersDance.Views" x:Name="UserControl" - d:DesignWidth="640" d:DesignHeight="480"> + d:DesignWidth="640" d:DesignHeight="480" Width="40"> - - + + + + \ No newline at end of file diff -r 31900a35e162 -r 7ce946833eae src/FingersDance.Views/TimelineAnnotationView.xaml.cs --- a/src/FingersDance.Views/TimelineAnnotationView.xaml.cs Wed Sep 16 19:32:26 2009 +0200 +++ b/src/FingersDance.Views/TimelineAnnotationView.xaml.cs Thu Sep 17 13:06:22 2009 +0200 @@ -31,7 +31,8 @@ { ThicknessConverter myThicknessConverter = new ThicknessConverter(); Thickness th1 = (Thickness)myThicknessConverter.ConvertFrom(value); - th1.Top = th1.Top; + th1.Top = 0; + th1.Bottom = th1.Right = 0; return th1; } public object ConvertBack(object value, Type targetTypes, object parameter, System.Globalization.CultureInfo culture) diff -r 31900a35e162 -r 7ce946833eae src/FingersDance.Views/TimelineView.xaml --- a/src/FingersDance.Views/TimelineView.xaml Wed Sep 16 19:32:26 2009 +0200 +++ b/src/FingersDance.Views/TimelineView.xaml Thu Sep 17 13:06:22 2009 +0200 @@ -2,13 +2,10 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vw="clr-namespace:FingersDance.Views" - Height="300" Width="300"> + > - - - + @@ -36,5 +33,6 @@ +