private void FullScreen_Click(object sender, RoutedEventArgs e) { //open a new window full screen if (fullWindow == null) { fullWindow = new FullScreen(); fullWindow.Closing += new CancelEventHandler(fullWindow_Closing); } net.SendChatMessage(ChatMessage.Create(ChatCommand.StreamVideo, (string)MediaList.SelectedItem)); }
void fullWindow_Closing(object sender, CancelEventArgs e) { //assign to null so that we won't try to play a video with a Closed window which throws an exception fullWindow = null; }