client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs
changeset 22 69a2910ec6f9
parent 15 3f70aee2432f
child 25 a9c815025a1b
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs	Mon Dec 14 09:56:55 2009 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs	Mon Dec 14 11:25:01 2009 +0100
@@ -284,30 +284,25 @@
         }
         private void InitializeCommands()
         {
-          
-            Commands.VideoViewer.SendPosition.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(SendPosition_Executed);
-        }
+            ActualVideoSourceVM.Tick += new EventHandler<VideoViewerVMEventArgs>(ActualVideoSourceVM_Tick);
+              }
 
-      
-
-        void SendPosition_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
+        void ActualVideoSourceVM_Tick(object sender, VideoViewerVMEventArgs e)
         {
-            TimeSpan Pos = ((TimeSpan)e.Parameter);
+            TimeSpan Pos = e.Position; 
             SelectedBookVM.Position = Pos.TotalMilliseconds;
             if (SelectedIndex.TimerOut < Pos || SelectedIndex.TimerIn > Pos)
             {
-               foreach(SegmentIndex Index in SelectedIndex.Chapter.Index)
-               {
-                   if(Index.TimerIn <= Pos && Index.TimerOut>= Pos)
-                   {
-                       SelectedIndex = Index;
-                   }
-                  
-               }
+                foreach (SegmentIndex Index in SelectedIndex.Chapter.Index)
+                {
+                    if (Index.TimerIn <= Pos && Index.TimerOut >= Pos)
+                    {
+                        SelectedIndex = Index;
+                    }
+
+                }
             }
         }
-
-        
        
     }
 }