Problem with stopping video on back press in UWP

Problem with stopping video on back press in UWP

I have a UWP app with NavigationView that handles the backstack in different frames. The back press is handled in my MainPage.xaml by the function:

I have a UWP app with NavigationView that handles the backstack in different frames. The back press is handled in my MainPage.xaml by the function:

private bool On_BackRequested()
        {
            if (contentFrame.CanGoBack)
            {
                contentFrame.GoBack();
                Debug.WriteLine(contentFrame.);
                return true;
            }
            return false;
        }

But the problem arises when there is a MediaPlayerElement playing videos in a frame. The back press is handled properly but the video doesn't stop playing (I know this because the audio from the video is still playing in the background).

How can I stop the video playback during the back press method? Can I access a certain function from the childframe to stop the video?

xaml windows

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Calling Windows 10 APIs From Your WPF Application

Did you know that you can call Windows 10 WinRT APIs from your WPF and WinForms apps? In this blog post I’ll show you how to display toast messages from a WPF application by using the Windows.

Windows Server Setup and Management - Global TechForce

Are you looking for the best outsource it services company for [windows server setup](https://www.global-techforce.com/solutions-for-your-business/windows-server-support/ "windows server setup")? Don't forget to visit Global TechForce for best and...

Install Flutter on Windows 10 and Setup Flutter Windows Desktop

Install Flutter on Windows 10 can be a challenge, let your application run as a Windows Application even more. This tutorial will help you set up your window...

Pluralsight Courses for .NET Windows Developers

On Pluralsight you can watch 7000+ expert-led video courses. Pluralsight is FREE to individuals for the entire month of April 2020 – now is the perfect time to become a .NET Windows Developer…

How to Install Linux Mint on VirtualBox on Windows 10

How to Install Linux Mint on VirtualBox on Windows 10