From 517db73114c997afe0ba5c388e62861b721ffddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=91=D1=83?= =?UTF-8?q?=D1=80=D0=B0=D0=B9=D0=BA=D0=B8=D0=BD?= Date: Mon, 2 Oct 2017 09:18:06 +0300 Subject: [PATCH] Fix set IsPlaying property of MediaElementBase after call Pause() method --- Source/DirectShow/Controls/MediaElementBase.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/DirectShow/Controls/MediaElementBase.cs b/Source/DirectShow/Controls/MediaElementBase.cs index 0831b31..f187217 100644 --- a/Source/DirectShow/Controls/MediaElementBase.cs +++ b/Source/DirectShow/Controls/MediaElementBase.cs @@ -570,8 +570,11 @@ public virtual void Play() public virtual void Pause() { MediaPlayerBase.EnsureThread(DefaultApartmentState); - MediaPlayerBase.Dispatcher.BeginInvoke((Action)(() => MediaPlayerBase.Pause())); - SetIsPlaying(false); + MediaPlayerBase.Dispatcher.BeginInvoke((Action)delegate + { + MediaPlayerBase.Pause(); + Dispatcher.BeginInvoke((Action)(() => SetIsPlaying(false))); + }); } ///