private void PreferencesChanged(object sender, PropertyChangedEventArgs e) { if (Preferences != null) { if (e.PropertyName == "Show") { if (Preferences.Show) { preferencesWindow = new PreferencesWindow(preferencesWindowTabSelected) { Owner = this }; preferencesWindow.Show(); } else if (preferencesWindow != null) { preferencesWindow.Close(); preferencesWindow = null; } } } }