private void btConnect_Click(object sender, RoutedEventArgs e) { // search for the USB device and connect if available usbController.findTargetDevice(); if (usbController.getDeviceStatus()) { this.lblStatus.Content = "Connected"; } else { this.lblStatus.Content = "Connection Failed"; } }