public DeejControlWizardViewModel(string title, HardwareSettingsViewModel hardwareSettings,
                                   DeejConfiguration config) : this(title, hardwareSettings)
 {
     MinValue     = config.MinValue;
     MaxValue     = config.MaxValue;
     ScalingValue = config.ScalingValue;
     SelectedDeej = config.Port;
     _capturedDeejInControls.Add("Channel=" + config.Channel +
                                 ", Value=0");
 }
        public void SaveDeejControl()
        {
            // Check for valid widget entries.
            if (string.IsNullOrEmpty(SelectedDeej) ||
                CapturedDeejInControls.Count <= 0 ||
                string.IsNullOrEmpty(CapturedDeejInControls[CapturedDeejInControlsSelected]))
            {
                MessageBox.Show(Properties.Resources.IncompleteDeviceConfigurationMessage, "EarTrumpet", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            // Generate Deej control configuration object.
            DeejConfiguration deejConfiguration = new DeejConfiguration(SelectedDeej, GetCurrentSelectionProperty("Channel"), MinValue, MaxValue, ScalingValue);

            // Notify the hardware settings about the new control configuration.
            _hardwareSettings.ControlSelectedCallback(deejConfiguration);
        }