Esempio n. 1
0
 public static void StartLoading1(List<ComboBox> scv, ref int screen, DisplayUnitConfiguration temp, CheckBox useCustomHeaderCheck, TextBox headerTextBox, ref bool firstLoad)
 {
     foreach (ComboBox cbox in scv)
     {
         cbox.SelectedIndex = -1;
         cbox.IsEnabled = false;
     }
     scv[0].IsEnabled = true;
     screen = temp.ScreenToEdit;
     if (temp.Screens[screen].Variables.Count > 0)
     {
         for (int i = 0; i < temp.Screens[screen].Variables.Count; i++)
         {
             scv[i].IsEnabled = true;
             DisplayVarsEnum temp222;
             if (Enum.TryParse(temp.Screens[screen].Variables[i], out temp222))
             {
                 scv[i].SelectedItem = temp.HostApp.DisplayMngr.Dictionarys.DisplayVariables[temp222].Name;
             }
             else
             {
                 scv[i].SelectedIndex = -1;
             }
         }
     }
     else
     {
         scv[0].IsEnabled = true;
         scv[0].SelectedIndex = -1;
     }
     useCustomHeaderCheck.IsChecked = temp.Screens[screen].UseCustomHeader;
     headerTextBox.Text = temp.Screens[screen].CustomHeader;
     firstLoad = false;
 }
Esempio n. 2
0
 private void StartLoading()
 {
     this.firstLoad = true;
     this.Temp = (DisplayUnitConfiguration) this.DataContext;
     this.scv = new List<ComboBox>
         {
             this.ScreenVariable1CBox,
             this.ScreenVariable2CBox,
             this.ScreenVariable3CBox,
             this.ScreenVariable4CBox,
             this.ScreenVariable5CBox,
             this.ScreenVariable6CBox
         };
     foreach (var variable in this.Temp.HostApp.DisplayMngr.Dictionarys.DisplayVariables)
     {
         foreach (ComboBox comboBox in this.scv)
         {
             comboBox.Items.Add(variable.Value.Name);
         }
     }
     PageHelper.StartLoading1(this.scv, ref this.screen, this.Temp, this.UseCustomHeaderCheck, this.HeaderTextBox, ref this.firstLoad);
 }
Esempio n. 3
0
        public void LoadConfiguration(Configuration configuration, Dictionarys dicts)
        {
            Name = configuration.Name;
            FileLocation = configuration.FileLocation;
            Intensity = configuration.TMDisplaySettings.Intensity;
            ShiftIntensity = configuration.TMDisplaySettings.ShiftIntensity;
            ShiftIntensityType = configuration.TMDisplaySettings.ShiftIntensityType;
            ShiftIntensityAmount = configuration.TMDisplaySettings.ShiftIntensityAmount;
            ShowHeader = configuration.TMDisplaySettings.ShowHeaders;
            HeaderDisplayTime = configuration.TMDisplaySettings.HeaderDisplayTime - 1;
            QuickInfoDisplayTime = configuration.TMDisplaySettings.QuickInfoDisplayTime - 1;
            LapTimeDisplayTime = configuration.TMDisplaySettings.LapDisplayTime - 1;
            PreferredComPort = configuration.SerialPortSettings.PreferredComPort;
            LogArduinoMessages = configuration.AdvancedSettings.LogArduinoMessages;
            SerialPortSpeed = configuration.SerialPortSettings.SerialPortSpeed.ToString(CultureInfo.InvariantCulture);
            DisplayRefreshRate = configuration.RefreshRates.DisplayRefreshRate.ToString(CultureInfo.InvariantCulture);
            LEDRefreshRate = configuration.RefreshRates.LEDRefreshRate.ToString(CultureInfo.InvariantCulture);
            UseCustomSerialSpeed = configuration.SerialPortSettings.UseCustomSerialSpeed;
            ColourDeltaByDD = configuration.TMDisplaySettings.ColourDeltaByDD;
            DeltaLightsOnDefault = configuration.TMDisplaySettings.DeltaLightsOnDefault;
            DeltaMessageScreen = configuration.TMDisplaySettings.DeltaMessageScreen;
            DeltaRange = configuration.TMDisplaySettings.DeltaRange - 1;
            UseCustomFuelCalculationOptions = configuration.OtherSettings.UseCustomFuelCalculationOptions;
            FuelCalculationLaps = configuration.OtherSettings.FuelCalculationLaps - 2;
            UseWeightedFuelCalculations = configuration.OtherSettings.UseWeightedFuelCalculations;
            WarningTextDisplayTime = configuration.TMDisplaySettings.WarningTextDisplayTime - 1;
            QuickInfoLightsColour = configuration.TMDisplaySettings.QuickInfoLightsColour;

            ArduinoIOConfiguration = new ArduinoIO();
            FergoTechConfiguration = new FergoTechComponents();

            ControllerConfigurations = new List<ControllerButtonConfiguration>();
            foreach (ControllerConfiguration item in configuration.ControllerConfigurations)
            {
                var temp = new ControllerButtonConfiguration
                    {
                        DeviceGuid = item.DeviceGuid,
                        ButtonNumbers = item.ButtonNumbers,
                        ButtonOptions = item.ButtonOptions,
                        ButtonOptionsScreens = item.ButtonOptionsScreens,
                        Selected = item.Selected
                    };
                for (int k = 0; k < Constants.MaxNumberJoystickButtons; k++)
                {
                    temp.ButtonFunctions[k] = dicts.ButtonFunctions[item.ButtonFunctions[k]].Name;
                }
                ControllerConfigurations.Add(temp);
            }
            NumberControllers = configuration.ControllerConfigurations.Count;
            DisplayUnitConfigurations = new List<DisplayUnitConfiguration>();
            int unitCount = 0;
            foreach (DisplayConfiguration displayConf in configuration.DisplayConfigurations)
            {
                unitCount++;
                var temp = new DisplayUnitConfiguration
                    {
                        NumScreens = displayConf.NumScreens - 1,
                        Inverted = displayConf.Inverted,
                        IsTM1640 = displayConf.IsTM1640,
                        SwitchLEDs = displayConf.SwitchLEDs,
                        ShowDC = displayConf.ShowDC,
                        DCDisplayTime = displayConf.DCDisplayTime,
                        ShowLap = displayConf.ShowLap,
                        ButtonConfigurations = new ButtonConfiguration(),
                        UnitNumber = unitCount,
                        ShowEngineWarnings = displayConf.ShowEngineWarnings
                    };
                DisplayConfiguration conf = displayConf;
                foreach (var lstyle in dicts.LapDisplayStyles.Where(lstyle => conf.LapStyle == lstyle.Value))
                {
                    temp.LapStyle = lstyle.Key;
                } foreach (var wtype in dicts.WarningTypes.Where(wtype => conf.WarningType == wtype.Value))
                {
                    temp.WarningType = wtype.Key;
                }

                for (int n = 0; n < Constants.NumberButtonsOnTm1638; n++)
                {
                    temp.ButtonConfigurations.ButtonFunctions[n] =
                        dicts.ButtonFunctions[displayConf.ButtonFunctions[n]].Name;
                    temp.ButtonConfigurations.ButtonOptions[n] = displayConf.ButtonOptions[n];
                    temp.ButtonConfigurations.ButtonOptionsScreens[n] = displayConf.ButtonOptionsScreens[n];
                }
                temp.LEDsConfigurations = new LEDsConfiguration
                                              {
                                                      FFBClippingLights = displayConf.FFBClippingLights,
                                                      FFBClippingScreen = displayConf.FFBClippingScreen - 1,
                                                      PitLights = displayConf.PitLights,
                                                      RevLimiterLights = displayConf.RevLimiterLights,
                                                      ShowShiftLights = displayConf.ShowShiftLights,
                                                      ShiftClumps = displayConf.ShiftClumps,
                                                      MatchCarShiftLights = displayConf.MatchCarShiftStyle,
                                                      MatchRedShift = displayConf.MatchRedShift,
                                                      DeltaLightsShow = displayConf.DeltaLightsShow,
                                                      MatchCarShiftOptions = "",
                                              };
                foreach (var opt in dicts.MatchCarShiftOptions)
                {
                    if (opt.Value == displayConf.MatchCarShiftStyleOption)
                    {
                        temp.LEDsConfigurations.MatchCarShiftOptions = opt.Key;
                    }
                }
                temp.LEDsConfigurations.DeltaLightsPosition = "";
                foreach (var opt in dicts.DeltaLightsPositionOptions)
                {
                    if (opt.Value == displayConf.DeltaLightsPosition)
                    {
                        temp.LEDsConfigurations.DeltaLightsPosition = opt.Key;
                    }
                }
                foreach (var plspeed in dicts.PitFlashSpeeds)
                {
                    if (plspeed.Value == displayConf.PitLimiterSpeed)
                    {
                        temp.LEDsConfigurations.PitLimiterSpeed = plspeed.Key;
                    }
                }
                foreach (var plstyle in dicts.PitFlashStyles)
                {
                    if (plstyle.Value == displayConf.PitLimiterStyle)
                    {
                        temp.LEDsConfigurations.PitLimiterStyle = plstyle.Key;
                    }
                }
                foreach (var revlstyle in dicts.RevFlashStyles)
                {
                    if (revlstyle.Value == displayConf.RevLimiterStyle)
                    {
                        temp.LEDsConfigurations.RevLimiterStyle = revlstyle.Key;
                    }
                }
                foreach (var shiftstyle in dicts.ShiftStyles)
                {
                    if (shiftstyle.Value == displayConf.ShiftLightStyle)
                    {
                        temp.LEDsConfigurations.ShiftLightStyle = shiftstyle.Key;
                    }
                }
                temp.Screens = displayConf.Screens;
                DisplayUnitConfigurations.Add(temp);
            }
        }
Esempio n. 4
0
        public void LoadConfiguration(Configuration configuration, Dictionarys dicts)
        {
            Name                            = configuration.Name;
            FileLocation                    = configuration.FileLocation;
            Intensity                       = configuration.TMDisplaySettings.Intensity;
            ShiftIntensity                  = configuration.TMDisplaySettings.ShiftIntensity;
            ShiftIntensityType              = configuration.TMDisplaySettings.ShiftIntensityType;
            ShiftIntensityAmount            = configuration.TMDisplaySettings.ShiftIntensityAmount;
            ShowHeader                      = configuration.TMDisplaySettings.ShowHeaders;
            HeaderDisplayTime               = configuration.TMDisplaySettings.HeaderDisplayTime - 1;
            QuickInfoDisplayTime            = configuration.TMDisplaySettings.QuickInfoDisplayTime - 1;
            LapTimeDisplayTime              = configuration.TMDisplaySettings.LapDisplayTime - 1;
            PreferredComPort                = configuration.SerialPortSettings.PreferredComPort;
            LogArduinoMessages              = configuration.AdvancedSettings.LogArduinoMessages;
            SerialPortSpeed                 = configuration.SerialPortSettings.SerialPortSpeed.ToString(CultureInfo.InvariantCulture);
            DisplayRefreshRate              = configuration.RefreshRates.DisplayRefreshRate.ToString(CultureInfo.InvariantCulture);
            LEDRefreshRate                  = configuration.RefreshRates.LEDRefreshRate.ToString(CultureInfo.InvariantCulture);
            UseCustomSerialSpeed            = configuration.SerialPortSettings.UseCustomSerialSpeed;
            ColourDeltaByDD                 = configuration.TMDisplaySettings.ColourDeltaByDD;
            DeltaLightsOnDefault            = configuration.TMDisplaySettings.DeltaLightsOnDefault;
            DeltaMessageScreen              = configuration.TMDisplaySettings.DeltaMessageScreen;
            DeltaRange                      = configuration.TMDisplaySettings.DeltaRange - 1;
            UseCustomFuelCalculationOptions = configuration.OtherSettings.UseCustomFuelCalculationOptions;
            FuelCalculationLaps             = configuration.OtherSettings.FuelCalculationLaps - 2;
            UseWeightedFuelCalculations     = configuration.OtherSettings.UseWeightedFuelCalculations;
            WarningTextDisplayTime          = configuration.TMDisplaySettings.WarningTextDisplayTime - 1;
            QuickInfoLightsColour           = configuration.TMDisplaySettings.QuickInfoLightsColour;

            ControllerConfigurations = new List <ControllerButtonConfiguration>();
            foreach (ControllerConfiguration item in configuration.ControllerConfigurations)
            {
                var temp = new ControllerButtonConfiguration
                {
                    DeviceGuid           = item.DeviceGuid,
                    ButtonNumbers        = item.ButtonNumbers,
                    ButtonOptions        = item.ButtonOptions,
                    ButtonOptionsScreens = item.ButtonOptionsScreens,
                    Selected             = item.Selected
                };
                for (int k = 0; k < Constants.MaxNumberJoystickButtons; k++)
                {
                    temp.ButtonFunctions[k] = dicts.ButtonFunctions[item.ButtonFunctions[k]].Name;
                }
                ControllerConfigurations.Add(temp);
            }
            NumberControllers         = configuration.ControllerConfigurations.Count;
            DisplayUnitConfigurations = new List <DisplayUnitConfiguration>();
            int unitCount = 0;

            foreach (DisplayConfiguration displayConf in configuration.DisplayConfigurations)
            {
                unitCount++;
                var temp = new DisplayUnitConfiguration
                {
                    NumScreens           = displayConf.NumScreens - 1,
                    Inverted             = displayConf.Inverted,
                    IsTM1640             = displayConf.IsTM1640,
                    SwitchLEDs           = displayConf.SwitchLEDs,
                    ShowDC               = displayConf.ShowDC,
                    DCDisplayTime        = displayConf.DCDisplayTime,
                    ShowLap              = displayConf.ShowLap,
                    ButtonConfigurations = new ButtonConfiguration(),
                    UnitNumber           = unitCount,
                    ShowEngineWarnings   = displayConf.ShowEngineWarnings
                };
                DisplayConfiguration conf = displayConf;
                foreach (var lstyle in dicts.LapDisplayStyles.Where(lstyle => conf.LapStyle == lstyle.Value))
                {
                    temp.LapStyle = lstyle.Key;
                }
                foreach (var wtype in dicts.WarningTypes.Where(wtype => conf.WarningType == wtype.Value))
                {
                    temp.WarningType = wtype.Key;
                }

                for (int n = 0; n < Constants.NumberButtonsOnTm1638; n++)
                {
                    temp.ButtonConfigurations.ButtonFunctions[n] =
                        dicts.ButtonFunctions[displayConf.ButtonFunctions[n]].Name;
                    temp.ButtonConfigurations.ButtonOptions[n]        = displayConf.ButtonOptions[n];
                    temp.ButtonConfigurations.ButtonOptionsScreens[n] = displayConf.ButtonOptionsScreens[n];
                }
                temp.LEDsConfigurations = new LEDsConfiguration
                {
                    FFBClippingLights    = displayConf.FFBClippingLights,
                    FFBClippingScreen    = displayConf.FFBClippingScreen - 1,
                    PitLights            = displayConf.PitLights,
                    RevLimiterLights     = displayConf.RevLimiterLights,
                    ShowShiftLights      = displayConf.ShowShiftLights,
                    ShiftClumps          = displayConf.ShiftClumps,
                    MatchCarShiftLights  = displayConf.MatchCarShiftStyle,
                    MatchRedShift        = displayConf.MatchRedShift,
                    DeltaLightsShow      = displayConf.DeltaLightsShow,
                    MatchCarShiftOptions = "",
                };
                foreach (var opt in dicts.MatchCarShiftOptions)
                {
                    if (opt.Value == displayConf.MatchCarShiftStyleOption)
                    {
                        temp.LEDsConfigurations.MatchCarShiftOptions = opt.Key;
                    }
                }
                temp.LEDsConfigurations.DeltaLightsPosition = "";
                foreach (var opt in dicts.DeltaLightsPositionOptions)
                {
                    if (opt.Value == displayConf.DeltaLightsPosition)
                    {
                        temp.LEDsConfigurations.DeltaLightsPosition = opt.Key;
                    }
                }
                foreach (var plspeed in dicts.PitFlashSpeeds)
                {
                    if (plspeed.Value == displayConf.PitLimiterSpeed)
                    {
                        temp.LEDsConfigurations.PitLimiterSpeed = plspeed.Key;
                    }
                }
                foreach (var plstyle in dicts.PitFlashStyles)
                {
                    if (plstyle.Value == displayConf.PitLimiterStyle)
                    {
                        temp.LEDsConfigurations.PitLimiterStyle = plstyle.Key;
                    }
                }
                foreach (var revlstyle in dicts.RevFlashStyles)
                {
                    if (revlstyle.Value == displayConf.RevLimiterStyle)
                    {
                        temp.LEDsConfigurations.RevLimiterStyle = revlstyle.Key;
                    }
                }
                foreach (var shiftstyle in dicts.ShiftStyles)
                {
                    if (shiftstyle.Value == displayConf.ShiftLightStyle)
                    {
                        temp.LEDsConfigurations.ShiftLightStyle = shiftstyle.Key;
                    }
                }
                temp.Screens = displayConf.Screens;
                DisplayUnitConfigurations.Add(temp);
            }
        }
Esempio n. 5
0
        private void PageLoaded1(object sender, RoutedEventArgs e)
        {
            this.Temp = (DisplayUnitConfiguration) this.DataContext;
            this.ButtonFunctionsCBoxs = new List<ComboBox>
                {
                    this.ButtonFunctionCBox1,
                    this.ButtonFunctionCBox2,
                    this.ButtonFunctionCBox3,
                    this.ButtonFunctionCBox4,
                    this.ButtonFunctionCBox5,
                    this.ButtonFunctionCBox6,
                    this.ButtonFunctionCBox7,
                    this.ButtonFunctionCBox8
                };
            this.ButtonOptionsCBoxs = new List<ComboBox>
                {
                    this.ButtonOptionCBox1,
                    this.ButtonOptionCBox2,
                    this.ButtonOptionCBox3,
                    this.ButtonOptionCBox4,
                    this.ButtonOptionCBox5,
                    this.ButtonOptionCBox6,
                    this.ButtonOptionCBox7,
                    this.ButtonOptionCBox8
                };
            this.ButtonScreensCBoxs = new List<ComboBox>
                {
                    this.ButtonScreenCBox1,
                    this.ButtonScreenCBox2,
                    this.ButtonScreenCBox3,
                    this.ButtonScreenCBox4,
                    this.ButtonScreenCBox5,
                    this.ButtonScreenCBox6,
                    this.ButtonScreenCBox7,
                    this.ButtonScreenCBox8
                };
            //populate combo boxs
            foreach (var butFunc in this.Temp.HostApp.DisplayMngr.Dictionarys.ButtonFunctions)
            {
                foreach (ComboBox cbox in this.ButtonFunctionsCBoxs)
                {
                    cbox.Items.Add(butFunc.Value.Name);
                }
            }
            foreach (ComboBox cBox in this.ButtonScreensCBoxs)
            {
                cBox.IsEnabled = true;
                cBox.Items.Add("All");
                cBox.Items.Add("Current");
                for (int i = 1; i <= this.Temp.TotalUnits + 1; i++)
                {
                    cBox.Items.Add(i.ToString(CultureInfo.InvariantCulture));
                }
            }

            //data bind
            for (int x = 0; x < Constants.NumberButtonsOnTm1638; x++)
            {
                var buttonFuncBinding = new Binding(String.Format("ButtonConfigurations.ButtonFunctions[{0}]", x))
                    {
                        Mode = BindingMode.TwoWay
                    };
                BindingOperations.SetBinding(this.ButtonFunctionsCBoxs[x], Selector.SelectedValueProperty, buttonFuncBinding);
                var buttonOptBinding = new Binding(String.Format("ButtonConfigurations.ButtonOptions[{0}]", x))
                    {
                        Mode = BindingMode.TwoWay
                    };
                BindingOperations.SetBinding(this.ButtonOptionsCBoxs[x], Selector.SelectedValueProperty, buttonOptBinding);
                var buttonScreenBinding = new Binding(String.Format("ButtonConfigurations.ButtonOptionsScreens[{0}]", x))
                    {
                        Mode = BindingMode.TwoWay
                    };
                BindingOperations.SetBinding(this.ButtonScreensCBoxs[x], Selector.SelectedIndexProperty, buttonScreenBinding);
            }
        }
Esempio n. 6
0
 public static void ScreenVariablesUpdatedExtracted(int maxDisplayLengthTM1638, string format, int param, List<ComboBox> scvIn, DisplayUnitConfiguration temp, Label spaceUsedLabel, bool firstLoadIn)
 {
     int count = 0;
     int i = 0;
     int stop = 0;
     while (count < maxDisplayLengthTM1638 && i < scvIn.Count)
     {
         stop = i + 1;
         if (scvIn[i].SelectedIndex >= 0)
         {
             count += temp.HostApp.DisplayMngr.Dictionarys.DisplayVariables.Where(item => item.Value.Name == scvIn[i].SelectedItem.ToString()).Sum(item => item.Value.Length);
             spaceUsedLabel.Content = String.Format(format, count);
             if (count > maxDisplayLengthTM1638)
             {
                 stop = i;
                 i = scvIn.Count;
             }
             i++;
         }
         else
         {
             scvIn[i].IsEnabled = true;
             scvIn[i].Items.Clear();
             foreach (var variable in temp.HostApp.DisplayMngr.Dictionarys.DisplayVariables)
             {
                 if (variable.Value.Length <= maxDisplayLengthTM1638 - count)
                 {
                     scvIn[i].Items.Add(variable.Value.Name);
                 }
             }
             i = scvIn.Count;
         }
     }
     for (int j = stop; j < scvIn.Count; j++)
     {
         scvIn[j].Items.Clear();
         scvIn[j].SelectedIndex = -1;
         scvIn[j].IsEnabled = false;
     }
     //save to config
     if (!firstLoadIn)
     {
         for (int p = 0; p < param; p++)
         {
             if (scvIn[p].SelectedValue != null)
             {
                 string tempV = scvIn[p].SelectedValue.ToString();
                 var temp2 = new DisplayVarsEnum();
                 bool found = false;
                 foreach (var disVar in temp.HostApp.DisplayMngr.Dictionarys.DisplayVariables)
                 {
                     if (disVar.Value.Name == tempV)
                     {
                         temp2 = disVar.Key;
                         found = true;
                     }
                 }
                 if (found)
                 {
                     if (temp.Screens[temp.ScreenToEdit].Variables.Count - 1 < p)
                     {
                         temp.Screens[temp.ScreenToEdit].Variables.Add("");
                     }
                     temp.Screens[temp.ScreenToEdit].Variables[p] = temp2.ToString();
                 }
             }
         }
     }
 }
Esempio n. 7
0
        private void PageLoaded1(object sender, RoutedEventArgs e)
        {
            this.FFBWhichScreenLabel.IsEnabled = false;
            this.RevLimiterStyleLabel.IsEnabled = false;
            this.PitLimiterFlashSpeedLabel.IsEnabled = false;
            this.PitLimiterStyleLabel.IsEnabled = false;
            this.ShiftLightStyleLabel.IsEnabled = false;
            this.MatchStyleOptionLabel.IsEnabled = false;

            //Populate CBOXs
            this.Temp = (DisplayUnitConfiguration) this.DataContext;
            foreach (var item in this.Temp.HostApp.DisplayMngr.Dictionarys.ShiftStyles)
            {
                this.ShiftLightStyleCBox.Items.Add(item.Key);
            }
            foreach (var item in this.Temp.HostApp.DisplayMngr.Dictionarys.RevFlashStyles)
            {
                this.RevLightStyleCBox.Items.Add(item.Key);
            }
            foreach (var item in this.Temp.HostApp.DisplayMngr.Dictionarys.PitFlashStyles)
            {
                this.PitLightStyleCBox.Items.Add(item.Key);
            }
            foreach (var item in this.Temp.HostApp.DisplayMngr.Dictionarys.PitFlashSpeeds)
            {
                this.PitLightSpeedCBox.Items.Add(item.Key);
            }
            for (int i = 1; i <= this.Temp.NumScreens + 1; i++)
            {
                this.FFBClipScreenCBox.Items.Add(i.ToString(CultureInfo.InvariantCulture));
            }
            foreach (var item in this.Temp.HostApp.DisplayMngr.Dictionarys.MatchCarShiftOptions)
            {
                this.MatchShiftLightsOptionCBox.Items.Add(item.Key);
            }
            //Data Bind
            var showShiftLightsBinding = new Binding("LEDsConfigurations.ShowShiftLights") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.ShowShiftLightsCheck, ToggleButton.IsCheckedProperty, showShiftLightsBinding);
            var matchShiftLightsBinding = new Binding("LEDsConfigurations.MatchCarShiftLights") { Mode = BindingMode.TwoWay };
            BindingOperations.SetBinding(this.MatchShiftLightsCheck, ToggleButton.IsCheckedProperty, matchShiftLightsBinding);
            var matchShiftOptionBinding = new Binding("LEDsConfigurations.MatchCarShiftOptions") { Mode = BindingMode.TwoWay };
            BindingOperations.SetBinding(
                this.MatchShiftLightsOptionCBox, Selector.SelectedValueProperty, matchShiftOptionBinding);
            var useMatchRedShiftBinding = new Binding("LEDsConfigurations.MatchRedShift") { Mode = BindingMode.TwoWay };
            BindingOperations.SetBinding(this.UseRedShiftCheck, ToggleButton.IsCheckedProperty, useMatchRedShiftBinding);
            var showPitLightsBinding = new Binding("LEDsConfigurations.PitLights") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.ShowPitLightsCheck, ToggleButton.IsCheckedProperty, showPitLightsBinding);
            var showRevLightsBinding = new Binding("LEDsConfigurations.RevLimiterLights") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.ShowRevLightsCheck, ToggleButton.IsCheckedProperty, showRevLightsBinding);
            var ffbClippingBinding = new Binding("LEDsConfigurations.FFBClippingLights") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.ShowFFBCheck, ToggleButton.IsCheckedProperty, ffbClippingBinding);
            var ffbClipScreenBinding = new Binding("LEDsConfigurations.FFBClippingScreen") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.FFBClipScreenCBox, Selector.SelectedIndexProperty, ffbClipScreenBinding);
            var shiftLightStyleBinding = new Binding("LEDsConfigurations.ShiftLightStyle") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.ShiftLightStyleCBox, Selector.SelectedItemProperty, shiftLightStyleBinding);
            var pitLightStyleBinding = new Binding("LEDsConfigurations.PitLimiterStyle") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.PitLightStyleCBox, Selector.SelectedItemProperty, pitLightStyleBinding);
            var pitLightSpeedBinding = new Binding("LEDsConfigurations.PitLimiterSpeed") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.PitLightSpeedCBox, Selector.SelectedItemProperty, pitLightSpeedBinding);
            var revLightStyleBinding = new Binding("LEDsConfigurations.RevLimiterStyle") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.RevLightStyleCBox, Selector.SelectedItemProperty, revLightStyleBinding);
            var shiftClumpsBinding = new Binding("LEDsConfigurations.ShiftClumps") {Mode = BindingMode.TwoWay};
            BindingOperations.SetBinding(this.ShiftClumpsCheck, ToggleButton.IsCheckedProperty, shiftClumpsBinding);
        }