private void NewLocalGame(object sender, RoutedEventArgs e) { TextBox p = (TextBox)FindName("pseudo"); string pseudo = p.Text; MainWindow mainWindow = (MainWindow)Window.GetWindow(this); GameVue game = new GameVue(pseudo); mainWindow.ContentArea.Navigate(game); }
private void Host(object sender, RoutedEventArgs e) { TextBox ipT = (TextBox)FindName("monIp"); string ip = ipT.Text; TextBox portT = (TextBox)FindName("port"); int port = Int32.Parse(portT.Text); MainWindow mainWindow = (MainWindow)Window.GetWindow(this); GameVue game = new GameVue(ip, port, true, pseudo); mainWindow.ContentArea.Navigate(game); }
private void Join(object sender, RoutedEventArgs e) { /* MainWindow mainWindow = (MainWindow)Window.GetWindow(this); * GameVue game = new GameVue(); * mainWindow.ContentArea.Navigate(game);*/ TextBox ipT = (TextBox)FindName("ipS"); string ip = ipT.Text; TextBox portT = (TextBox)FindName("portS"); int port = Int32.Parse(portT.Text); MainWindow mainWindow = (MainWindow)Window.GetWindow(this); GameVue game = new GameVue(ip, port, false, pseudo); mainWindow.ContentArea.Navigate(game); }
private void NewLocalGame(object sender, RoutedEventArgs e) { MainWindow mainWindow = (MainWindow)Window.GetWindow(this); GameVue game; if (online) { game = new GameVue(ip, port, host, pseudo); } else { game = new GameVue(pseudo); } mainWindow.ContentArea.Navigate(game); }