private void ViewModel_Logout(object sender, EventArgs e) { _loginWindow = new LoginWindow { DataContext = _loginViewModel }; _loginViewModel = new LoginViewModel(_service); _loginViewModel.ExitApplication += ViewModel_ExitApplication; _loginViewModel.MessageApplication += ViewModel_MessageApplication; _loginViewModel.LoginSuccess += ViewModel_LoginSuccess; _loginViewModel.LoginFailed += ViewModel_LoginFailed; _loginWindow.Show(); _menuWindow.Close(); }
private void SearchingGameResponse(string message) { if (message == "game found") { this.gameplayWindow = new GameplayWindow(); this.gameplayWindow.WantMove += GameplayWindow_WantMove; this.gameplayWindow.Move += GameplayWindow_Move; this.gameplayWindow.DeletePawn += GameplayWindow_DeletePawn; fields = gameplayWindow.fields; whitePawns = gameplayWindow.whitePawns; redPawns = gameplayWindow.redPawns; menuWindow.Close(); if (searchingGameWindow != null) { searchingGameWindow.Close(); } this.gameplayWindow.Show(); } else if (message == "wait") { this.searchingGameWindow = new SearchingGameWindow(); this.menuWindow.Close(); this.searchingGameWindow.Show(); } }