Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 17th, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Sync multiple MediaItems
  2. private void slider1_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
  3.     {
  4.  
  5.         videos[0].Position = TimeSpan.FromSeconds(slider1.Value);
  6.  
  7.         foreach (MediaElement elem in videos)
  8.         {
  9.             elem.Position = videos[0].Position;
  10.             elem.Play();
  11.         }
  12.        
  13. private void slider1_DragCompleted(object sender,    
  14.     System.Windows.Controls.Primitives.DragCompletedEventArgs e)
  15. {
  16.     var realPosition = TimeSpan.FromSeconds(slider1.Value);
  17.  
  18.     foreach (var elem in videos)
  19.     {
  20.         elem.Position = realPosition;
  21.     }
  22.  
  23.     foreach (var elem in videos)
  24.     {
  25.         elem.Play();
  26.     }