private void AddControlItem(string sceneID, InteractiveControlModel control)
        {
            InteractiveCommand command = ChannelSession.Settings.InteractiveCommands.FirstOrDefault(c => c.GameID.Equals(this.selectedGame.id) &&
                                                                                                    c.SceneID.Equals(sceneID) && c.Control.controlID.Equals(control.controlID));

            InteractiveControlCommandItem item = null;

            if (command != null)
            {
                command.UpdateWithLatestControl(control);
                item = new InteractiveControlCommandItem(command);
            }
            else if (control is InteractiveButtonControlModel)
            {
                item = new InteractiveControlCommandItem((InteractiveButtonControlModel)control);
            }
            else if (control is InteractiveJoystickControlModel)
            {
                item = new InteractiveControlCommandItem((InteractiveJoystickControlModel)control);
            }
            else if (control is InteractiveTextBoxControlModel)
            {
                item = new InteractiveControlCommandItem((InteractiveTextBoxControlModel)control);
            }

            if (item != null)
            {
                this.currentSceneControlItems.Add(item);
            }
        }
        private void NewInteractiveCommandButton_Click(object sender, RoutedEventArgs e)
        {
            Button button = (Button)sender;
            InteractiveControlCommandItem command = (InteractiveControlCommandItem)button.DataContext;
            CommandWindow window = null;

            if (command.Control is InteractiveButtonControlModel)
            {
                window = new CommandWindow(new InteractiveButtonCommandDetailsControl(this.selectedGame, this.selectedGameVersion, this.selectedScene, (InteractiveButtonControlModel)command.Control));
            }
            else if (command.Control is InteractiveJoystickControlModel)
            {
                window = new CommandWindow(new InteractiveJoystickCommandDetailsControl(this.selectedGame, this.selectedGameVersion, this.selectedScene, (InteractiveJoystickControlModel)command.Control));
            }
            else if (command.Control is InteractiveTextBoxControlModel)
            {
                window = new CommandWindow(new InteractiveTextBoxCommandDetailsControl(this.selectedGame, this.selectedGameVersion, this.selectedScene, (InteractiveTextBoxControlModel)command.Control));
            }

            if (window != null)
            {
                window.Closed += Window_Closed;
                window.Show();
            }
        }
        private void NewInteractiveCommandButton_Click(object sender, RoutedEventArgs e)
        {
            Button button = (Button)sender;
            InteractiveControlCommandItem command = (InteractiveControlCommandItem)button.DataContext;

            CommandWindow window = new CommandWindow(new InteractiveCommandDetailsControl(this.selectedGame, this.selectedGameVersion, this.selectedScene, command.Control));

            window.Closed += Window_Closed;
            window.Show();
        }