Ejemplo n.º 1
0
 private void MediaElementMediaOpened(object sender, RoutedEventArgs e)
 {
     Player.MediaElement.Pause();
       TimeLine.Slider.Minimum = 0;
       TimeLine.Slider.Maximum = Player.MediaElement.EndPosition.Ticks;
       TimeLine.EndPositionText.Text = TimespanToString(Player.MediaElement.EndPosition);
       var storedPosition = StorePosition();
       if (storedPosition != null && storedPosition != Player.MediaElement.EndPosition &&
       storedPosition != TimeSpan.FromSeconds(0))
       {
     CustomMessageBox box = new CustomMessageBox();
     box.Title = "Reprise lecture...";
     box.Message.Text = "Voulez-vous reprendre à la dernière lecture ?";
     box.Show();
     box.Closed += (s, a) =>
                 {
                   if ((bool) (s as CustomMessageBox).DialogResult)
                   {
                     Player.MediaElement.Position = ((TimeSpan) storedPosition) - TimeSpan.FromSeconds(5);
                     Player.MediaElement.Play();
                   }
                   else
                   {
                     Player.MediaElement.Play();
                   }
                 };
       }
 }
Ejemplo n.º 2
0
 private void cbCamp_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     txtPesquisa.Text = "";
     
     if (cbCamp.SelectedIndex == 2)
     {
         InputBox ipb = new InputBox();
         ipb.ShowDialog();
         if (ipb.dpData_d1.SelectedDate.Value == null || ipb.dpData_d2.SelectedDate.Value == null)
         {
             cmb = new CustomMessageBox("Insira data no formato: dd/mm/yyyy");
             cmb.Show();
         }
         else
         {
             dGrid.DataContext = opr.selectCombyPeriodo(ipb.dpData_d1.SelectedDate.Value, ipb.dpData_d2.SelectedDate.Value);
         }
     }
 }