private void Show2PButton_Click(object sender, RoutedEventArgs e)
 {
     if (Player2Window == null)
     {
         Player2Window         = new PlayerControlPanel(gameManager, viewModel.Players[1]);
         Player2Window.Closed += (ss, ee) => Player2Window = null;
         Player2Window.Show();
     }
     else
     {
         Player2Window.Close();
         Player2Window = null;
     }
 }
 public async Task <bool> InitGame(GameSettings.SettingStructure settings)
 {
     this.IsEnabled = false;
     if (!(await gameManager.InitGameData(settings)))
     {
         this.IsEnabled = true;
         return(false);
     }
     CreateCellOnCellGrid(gameManager.Data.BoardWidth, gameManager.Data.BoardHeight);
     if (settings.IsUser1P)
     {
         Player1Window         = new PlayerControlPanel(gameManager, viewModel.Players[0]);
         Player1Window.Closed += (ss, ee) => Player1Window = null;
         Player1Window.Show();
     }
     if (settings.IsUser2P)
     {
         Player2Window         = new PlayerControlPanel(gameManager, viewModel.Players[1]);
         Player2Window.Closed += (ss, ee) => Player2Window = null;
         Player2Window.Show();
     }
     this.IsEnabled = true;
     return(true);
 }