/// <summary> /// Called when [track progress]. /// </summary> /// <param name="trackProgressEvent">The track progress event.</param> private void OnTrackProgress(TrackProgressEvent trackProgressEvent) { dispatcher.BeginInvoke(new Action <TrackProgressEvent>(a => { var pos = TimeSpan.FromMilliseconds(a.Position); CurrentPositionString = GetTimeString(pos); if (hasSought) { return; } currentPosition = a.Position; // Don't set CurrentPosition directly as it will seek as well RaisePropertyChanged(() => CurrentPosition); }), trackProgressEvent); }
/// <summary> /// Called when [track progress]. /// </summary> /// <param name="trackProgressEvent">The track progress event.</param> private void OnTrackProgress(TrackProgressEvent trackProgressEvent) { dispatcher.BeginInvoke(new Action <TrackProgressEvent>(a => SetTrackProgress(a.Position)), trackProgressEvent); }