private void InitMusicWindow() { if (playMusicWindow == null) { PlayMusicWindowViewModel playMusicVM = new PlayMusicWindowViewModel(); playMusicWindow = new PlayMusicWindow(playMusicVM); playMusicWindow.StateChanged += playMusicWindow_StateChanged; playMusicWindow.Closed += playMusicWindow_Closed; } }
void playMusicWindow_Closed(object sender, EventArgs e) { playMusicWindow.StateChanged -= playMusicWindow_StateChanged; playMusicWindow.Closed -= playMusicWindow_Closed; playMusicWindow = null; ShowWebWindow(webWindow, true); InitMusicWindow(); }