private void IsLoged(bool isLoged) { if (!isLoged) { MessageBox.Show("We have connection problem try again later!"); var usernameWindow = new UsernameWindow(); usernameWindow.Show(); this.Close(); } }