I'm using C# and I'm trying to make my button click which navigates me to a new page, to play a sound. The problem is that I can't hear the sound playing because the media element is in the previous page. Is there a way to play a sound but to hear it in all pages? Here is my code:
private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{
this.Frame.Navigate(typeof(Game));
select.Play();
}
select is my sound .wav and it plays if I don't have the navigation code....
Playing a soundfile going from one form to the other like this should work fine. I placed my file in a Sounds folder inside the project
This way the problem that I had that the sound couldn't play the first time the app opens is fixed. :)