private void ControllerButton_MouseEnter(object sender, MouseEventArgs e)
        {
            Border button = (Border)sender;
            // remove "button" from control name
            string buttonStateName = button.Name.Substring(6);

            if (_controllerButtonState.GetButtonSelected(buttonStateName))
            {
                return;
            }

            button.Background = COLOR_BUTTON_MOUSE_OVER;
        }
        public WindowController(Settings settings, int index, Window owner)
        {
            InitializeComponent();

            // set owner
            Owner = owner;

            // create list of all controller buttons for later updates
            _controllerButtons = new List <Border>()
            {
                buttonPadUp,
                buttonPadDown,
                buttonPadLeft,
                buttonPadRight,
                buttonStart,
                buttonBack,
                buttonLeftThumb,
                buttonRightThumb,
                buttonLeftShoulder,
                buttonRightShoulder,
                buttonA,
                buttonB,
                buttonX,
                buttonY
            };

            // get settings
            _settings    = settings;
            _hotkeyIndex = index;
            if (_hotkeyIndex == -1)
            {
                // create new hotkey
                _hotkey                       = new Hotkey();
                _hotkey.isEnabled             = true;
                _hotkey.isCommandBatteryLevel = true;
            }
            else
            {
                // load existing hotkey
                _hotkey = _settings.hotkeys[_hotkeyIndex];
            }

            // set UI elements
            _checkEnabled  = false;
            inputName.Text = _hotkey.name;
            radioCommandTypeBatteryLevel.IsChecked = _hotkey.isCommandBatteryLevel;
            radioCommandTypeCustom.IsChecked       = !_hotkey.isCommandBatteryLevel;
            inputCommand.Text      = _hotkey.commandCustom;
            inputEnabled.IsChecked = _hotkey.isEnabled;
            _controllerButtonState = new ControllerButtonState();
            _controllerButtonState.Copy(_hotkey.buttonState);

            // set controlleer button colors
            foreach (Border controllerButton in _controllerButtons)
            {
                // remove "button" from control name
                string buttonStateName = controllerButton.Name.Substring(6);
                controllerButton.Background = (_controllerButtonState.GetButtonSelected(buttonStateName) ? COLOR_BUTTON_SELECTED : COLOR_BUTTON_DEFAULT);
            }

            _checkEnabled = true;
            Check();
        }