private async void SetSelectedCamera()
        {
            var capRes = new List <string>();
            CaptureCapabilities captureCapabilities = null;

            if (SelectedCamera == null)
            {
                return;
            }

            try
            {
                captureCapabilities = await _mediaSettings.GetVideoCaptureCapabilitiesAsync(SelectedCamera);
            }
            catch (Exception ex)
            {
                while (ex is AggregateException && ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }
                string errorMsg = "SetSelectedCamera: Failed to GetVideoCaptureCapabilities (Error: " + ex.Message + ")";
                Debug.WriteLine(errorMsg);
                var msgDialog = new MessageDialog(errorMsg);
                await msgDialog.ShowAsync();

                return;
            }
            if (captureCapabilities == null)
            {
                string errorMsg = "SetSelectedCamera: Failed to GetVideoCaptureCapabilities (Result is null)";
                Debug.WriteLine(errorMsg);
                var msgDialog = new MessageDialog(errorMsg);
                await msgDialog.ShowAsync();

                return;
            }

            var uniqueRes = captureCapabilities.Capabilities.GroupBy(test => test.ResolutionDescription)
                            .Select(grp => grp.FirstOrDefault()).ToList();
            CaptureCapability defaultResolution = null;

            foreach (var resolution in uniqueRes)
            {
                if (defaultResolution == null)
                {
                    defaultResolution = resolution;
                }
                capRes.Add(resolution.ResolutionDescription);
                if ((resolution.Width == 640) && (resolution.Height == 480))
                {
                    defaultResolution = resolution;
                }
            }
            string selectedCapResItem = string.Empty;

            if (_localSettings.Values[nameof(SelectedCapResItem)] != null)
            {
                selectedCapResItem = (string)_localSettings.Values[nameof(SelectedCapResItem)];
            }

            AllCapRes = new ObservableCollection <string>(capRes);
            if (!string.IsNullOrEmpty(selectedCapResItem) && AllCapRes.Contains(selectedCapResItem))
            {
                SelectedCapResItem = selectedCapResItem;
            }
            else
            {
                SelectedCapResItem = defaultResolution.ResolutionDescription;
            }
        }