/// <summary> /// Ferme une fenetre existante /// </summary> /// <param name="window"></param> public void Close(WindowsEnum window) { foreach (Window win in Application.Current.Windows) { if (window.ToString() == win.Title) { win.Close(); } } }
/// <summary> /// Ouvre une fenetre existante /// </summary> /// <param name="window"></param> public void OpenExisting(WindowsEnum window) { foreach (Window win in Application.Current.Windows) { if (window.ToString() == win.Title) { win.Show(); } } }
/* fermer une fenetre de la liste WindowEnum*/ public void CloseWindow(WindowsEnum windowsToClose) { /*pouur chaque fenetre win da l'application*/ foreach (Window win in Application.Current.Windows) { /*fermer la fenetre dont le nom est indiqué dans l'appel*/ if (win.Title == windowsToClose.ToString()) { win.Close(); } } }