private void btnStartCapture_Click(object sender, RoutedEventArgs e) { if (cameraDevice != null) { bool isCapturing; cameraDevice.IsCapturing(out isCapturing); if (!isCapturing) { cameraDevice.StartCapture(); capturing = true; btnStartCapture.Content = "Stop Capturing"; } else { cameraDevice.StopCapture(); capturing = false; btnStartCapture.Content = "Start Capturing"; } } }