From 4e8c9e09f3e348fa6d404c4d2680291172b21676 Mon Sep 17 00:00:00 2001 From: michael-hawker Date: Sun, 27 Oct 2019 16:03:51 -0700 Subject: [PATCH] Fix MediaPlayer property null for #106 and #68 Expose internal property which has correct reference, as was done for WinForms. --- .../MediaPlayerElement/MediaPlayerElement.cs | 2 +- .../MediaPlayerElement/MediaPlayerElement.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Toolkit.Forms.UI.Controls/MediaPlayerElement/MediaPlayerElement.cs b/Microsoft.Toolkit.Forms.UI.Controls/MediaPlayerElement/MediaPlayerElement.cs index 073e555..421143c 100644 --- a/Microsoft.Toolkit.Forms.UI.Controls/MediaPlayerElement/MediaPlayerElement.cs +++ b/Microsoft.Toolkit.Forms.UI.Controls/MediaPlayerElement/MediaPlayerElement.cs @@ -153,7 +153,7 @@ namespace Microsoft.Toolkit.Forms.UI.Controls [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public MediaPlayer MediaPlayer { - get => UwpControl.MediaPlayer; + get => UwpControl?.MediaPlayer; } } } diff --git a/Microsoft.Toolkit.Wpf.UI.Controls/MediaPlayerElement/MediaPlayerElement.cs b/Microsoft.Toolkit.Wpf.UI.Controls/MediaPlayerElement/MediaPlayerElement.cs index 8d1423a..290ca30 100644 --- a/Microsoft.Toolkit.Wpf.UI.Controls/MediaPlayerElement/MediaPlayerElement.cs +++ b/Microsoft.Toolkit.Wpf.UI.Controls/MediaPlayerElement/MediaPlayerElement.cs @@ -179,7 +179,7 @@ namespace Microsoft.Toolkit.Wpf.UI.Controls /// public MediaPlayer MediaPlayer { - get => (MediaPlayer)GetValue(MediaPlayerProperty); + get => UwpControl?.MediaPlayer; } } } \ No newline at end of file