public static void Hide()
 {
     if (window != null)
     {
         window.Close();
         window = null;
     }
 }