private void MenuItem_Click(object sender, RoutedEventArgs e) { if (this.thresholdSettingWindow == null) { this.thresholdSettingWindow = new ThresholdSetting(); this.thresholdSettingWindow.Owner = this; this.thresholdSettingWindow.Show(); } else { this.thresholdSettingWindow.Show(); } }