public void SwitchWindow(string windowId) { var windows = Application.Current.Windows; for (int i = 0; i < windows.Count; i++) { var w = windows[i]; if (windowId.Equals(w.Tag)) { w.Activate(); return; } } if (windowId == "Settings") { var w = new SettingsWindow { DataContext = CreateSettingViews() }; InitWindow(w); w.Show(); w.Activate(); } var view = layout[windowId]; if (view != null) { var w = new ModernWindow { Tag = windowId, Title = localization.GetLocalized("ViewTitle", windowId) ?? windowId, Content = view.LoadContent(), }; InitWindow(w); w.Show(); w.Activate(); } }
public void Activate() { _window.Activate(); }