client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs
changeset 22 69a2910ec6f9
parent 15 3f70aee2432f
child 25 a9c815025a1b
equal deleted inserted replaced
21:253f142174ac 22:69a2910ec6f9
   282 
   282 
   283 
   283 
   284         }
   284         }
   285         private void InitializeCommands()
   285         private void InitializeCommands()
   286         {
   286         {
   287           
   287             ActualVideoSourceVM.Tick += new EventHandler<VideoViewerVMEventArgs>(ActualVideoSourceVM_Tick);
   288             Commands.VideoViewer.SendPosition.Executed += new EventHandler<SLExtensions.Input.ExecutedEventArgs>(SendPosition_Executed);
   288               }
   289         }
   289 
   290 
   290         void ActualVideoSourceVM_Tick(object sender, VideoViewerVMEventArgs e)
   291       
   291         {
   292 
   292             TimeSpan Pos = e.Position; 
   293         void SendPosition_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
       
   294         {
       
   295             TimeSpan Pos = ((TimeSpan)e.Parameter);
       
   296             SelectedBookVM.Position = Pos.TotalMilliseconds;
   293             SelectedBookVM.Position = Pos.TotalMilliseconds;
   297             if (SelectedIndex.TimerOut < Pos || SelectedIndex.TimerIn > Pos)
   294             if (SelectedIndex.TimerOut < Pos || SelectedIndex.TimerIn > Pos)
   298             {
   295             {
   299                foreach(SegmentIndex Index in SelectedIndex.Chapter.Index)
   296                 foreach (SegmentIndex Index in SelectedIndex.Chapter.Index)
   300                {
   297                 {
   301                    if(Index.TimerIn <= Pos && Index.TimerOut>= Pos)
   298                     if (Index.TimerIn <= Pos && Index.TimerOut >= Pos)
   302                    {
   299                     {
   303                        SelectedIndex = Index;
   300                         SelectedIndex = Index;
   304                    }
   301                     }
   305                   
   302 
   306                }
   303                 }
   307             }
   304             }
   308         }
   305         }
   309 
       
   310         
       
   311        
   306        
   312     }
   307     }
   313 }
   308 }