// --- gui
        private void cboDevices_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            bool mappingEnabled = true;

            if (cboDevices.SelectedIndex == 1)
            {
                mappingEnabled = false;
            }

            lColorMapping.IsEnabled   = mappingEnabled;
            chkColorMapping.IsEnabled = mappingEnabled;
            lDepthMapping.IsEnabled   = mappingEnabled;
            chkDepthMapping.IsEnabled = mappingEnabled;

            Settings.SetSetting("mainCboDevices", cboDevices.SelectedItem.ToString());
        }
        private void LoadSettings()
        {
            // cboDevices
            string selectedItem = Settings.GetSetting("mainCboDevices");

            if (selectedItem != null && cboDevices.Items.Contains(selectedItem))
            {
                cboDevices.SelectedItem = selectedItem;
            }
            else
            {
                cboDevices.SelectedIndex = 0;
            }

            // colorMapping
            chkColorMapping.IsChecked = Settings.GetSettingBool("mainChkColorMapping");
            chkDepthMapping.IsChecked = Settings.GetSettingBool("mainChkDepthMapping");
        }
 private void chkDepthMapping_Checked(object sender, RoutedEventArgs e)
 {
     Settings.SetSetting("mainChkDepthMapping", ((bool)chkDepthMapping.IsChecked).ToString());
 }