Exemple #1
0
 private async void GSMTCSession_TimelinePropertiesChanged(GlobalSystemMediaTransportControlsSession session, TimelinePropertiesChangedEventArgs args)
 {
     await Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() =>
     {
         UpdateTimelineInfo(session);
     }));
 }
Exemple #2
0
        //TODO: This does not trigger
        private static void SmtcOnTimelinePropertiesChanged(GlobalSystemMediaTransportControlsSession sender, TimelinePropertiesChangedEventArgs args)
        {
            var pos = sender.GetTimelineProperties().Position.TotalSeconds;
            var max = sender.GetTimelineProperties().EndTime.TotalSeconds;

            var frac = pos / max * 100;

            MainWindow.Window.Dispatcher?.InvokeAsync(new Action(() => MainWindow.Window.Media_ProgressBar.Value = frac));
        }
 private void GSMTCSession_TimelinePropertiesChanged(GlobalSystemMediaTransportControlsSession session, TimelinePropertiesChangedEventArgs args)
 {
     Application.Current.Dispatcher.Invoke(() =>
     {
         UpdateTimelineInfo(session);
     });
 }