// // Connect the selected controller private async void OnBtnConnectControllerClick(object sender, RoutedEventArgs e) { if (_controller.IsConnected) { await _controller.Disconnect(); } else { UserIndex controllerIndex; if (!Enum.TryParse(cbController.Text, out controllerIndex)) { controllerIndex = UserIndex.Any; } await _controller.Connect(controllerIndex); } }