// Connect to the server and reset all values. public void ConnectButton_Click(object sender, RoutedEventArgs e) { try { vm.Connect(IP_Textbox.Text, PORT_Textbox.Text); } catch (Exception) { } joystickController.Aileron.Value = 0; joystickController.Throttle.Value = 0; }
async Task Connect() { connectButton.Enabled = false; if (wifiNameField.Text.ToLower() == TestWifi) { if (await viewModel.Connect(ConnectViewModel.TestHost, viewModel.Port)) { NavigationController.PushViewController(new ProgrammerViewController(main), true); } } else { statusLabel.Text = "Connecting..."; await WifiConnector.Connect(wifiNameField.Text, null); if (await viewModel.Connect(viewModel.Host, viewModel.Port)) { NavigationController.PushViewController(new ProgrammerViewController(main), true); } } connectButton.Enabled = true; }
private void Button_Click(object sender, RoutedEventArgs e) { if (is_connected == false) { connection.Content = "Disconnect"; vm.Connect(ip.Text, int.Parse(port.Text)); vm.SetFile(path.Text); is_connected = true; } else { connection.Content = "Connect"; vm.Disconnect(); is_connected = false; } }