client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml.cs
changeset 24 c031f1132dde
parent 23 10acb6a11a73
child 27 f292db96b050
--- a/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml.cs	Mon Dec 14 17:02:03 2009 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/ProductionTimeLine/ProductionTimeLine.xaml.cs	Wed Dec 16 17:14:38 2009 +0100
@@ -11,6 +11,7 @@
 using Iri.Modernisation.Data.Models;
 using Iri.Modernisation.Controls.ViewModel;
 using System.Collections.ObjectModel;
+using System.Globalization;
 namespace Iri.Modernisation.Controls.View
 {
   
@@ -20,7 +21,7 @@
         {
             get
             {
-                return 0.0001;
+                return 0.0002;
             }
         }
 		public ProductionTimeLine()
@@ -30,9 +31,22 @@
             Commands.ProductionTimeLine.EditorPartSelected.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(EditorPartSelected_Executed);
             Commands.ProductionView.VideoRecordUpdated.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(VideoRecordUpdated_Executed);
             Commands.Action.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(Action_Executed);
-          
+            TimeSlider.MouseLeftButtonUp += new MouseButtonEventHandler(TimeSlider_MouseLeftButtonUp);
+            //TimeSlider.ValueChanged += new RoutedPropertyChangedEventHandler<double>(TimeSlider_ValueChanged);
+            TimeSlider.Maximum = TimeSlider.ActualWidth / ProductionTimeLine.ScaleTime;
 		}
 
+        void TimeSlider_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            Commands.TimeChange.Execute(TimeSlider.Value,DataContext);
+        }
+
+        void TimeSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+        {
+            DeleteSequenceButton.Content = TimeSpan.FromMilliseconds(TimeSlider.Value);
+           
+        }
+
         void EditorPartSelected_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
         {
             UpdateElements();
@@ -51,6 +65,7 @@
         private double _sumOfLengh=0;
         public void UpdateElements()
         {
+            TimeSlider.Maximum = TimeSlider.ActualWidth / ProductionTimeLine.ScaleTime;
             if (DataContext != null)
             {
                 if (((ProductionTimeLineVM)this.DataContext).SelectedChapter != -1)
@@ -176,6 +191,8 @@
         private void AddSequenceButton_Click(object sender, System.Windows.RoutedEventArgs e)
         {
             AddSequenceButton.Content = ((ProductionTimeLineVM)DataContext).TotalBookDuration;
+           
+           
         }