My wpf app have two windows. One is used for playing musics, one for doing some other things.
I switch from windows 1 to windows 2 using code below:
Window2 window2 = new Window2 ();
App.Current.MainWindow = window2 ;
window2 .Show();
this.Close();
The problem is window2 is showed but window1 is still running(music still playing) althought window1 was disappeared (I hear the musics’s sound)
How can i stop all window1’s business before swtiching to window2?
1 Answer