private void MenuItem_FunnyImg_OnClick(object sender, RoutedEventArgs e) { if (_funnyImageWindow != null) _funnyImageWindow.Focus(); else { _funnyImageWindow = new FunnyImg(); _funnyImageWindow.Owner = this; _funnyImageWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; _funnyImageWindow.CloseEvent += FunnyImageClosed; _funnyImageWindow.Show(); } }
private void FunnyImageClosed(object sender, EventArgs e) { _funnyImageWindow = null; Focus(); }