public void SetImageSource(int index)
        {
            if (index > -1 && _selectedCameraIndex < WebcamManager.NumberConnectedCameras())
            {
                _selectedCameraIndex = index;
                WebCam camera = WebcamManager.GetCamera(index);
                long   mn = 0, mx = 0, step = 0;
                if (WebcamManager.GetMinPropertyValue(index, WebcamManager.CAMERA_PROPERTY.CAMERA_FOCUS, ref mn) && WebcamManager.GetMaxPropertyValue(index, WebcamManager.CAMERA_PROPERTY.CAMERA_FOCUS, ref mx))
                {
                    FocusMinimum = Convert.ToDouble(mn);
                    FocusMaximum = Convert.ToDouble(mx);
                    if (FocusMinimum != FocusMaximum)
                    {
                        Focus_Slider.IsEnabled = true;
                    }
                    else
                    {
                        FocusMinimum           = 0;
                        FocusMaximum           = 1;
                        Focus_Slider.IsEnabled = false;
                    }
                }
                else
                {
                    FocusMinimum           = 0;
                    FocusMaximum           = 1;
                    Focus_Slider.IsEnabled = false;
                }

                if (WebcamManager.GetMinPropertyValue(index, WebcamManager.CAMERA_PROPERTY.CAMERA_ZOOM, ref mn) && WebcamManager.GetMaxPropertyValue(index, WebcamManager.CAMERA_PROPERTY.CAMERA_ZOOM, ref mx))
                {
                    ZoomMinimum = Convert.ToDouble(mn);
                    ZoomMaximum = Convert.ToDouble(mx);
                    if (ZoomMinimum != ZoomMaximum)
                    {
                        Zoom_Slider.IsEnabled = true;
                    }
                    else
                    {
                        ZoomMinimum           = 0;
                        ZoomMaximum           = 1;
                        Zoom_Slider.IsEnabled = false;
                    }
                }
                else
                {
                    ZoomMinimum           = 0;
                    ZoomMaximum           = 1;
                    Zoom_Slider.IsEnabled = false;
                }

                Image_Viewer.SetImageSource(camera);
                Image_Viewer_Orig.SetImageSource(camera);
            }
        }