Author Topic: WDE Customization | Disable Agent State Menu  (Read 2077 times)

Offline vinicius.gaspar

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
WDE Customization | Disable Agent State Menu
« on: August 09, 2019, 03:21:37 PM »
I need to disable the ToolbarWindow's agent state menu to prevent state change attempts during After Call Work.

Link for the img: https://drive.google.com/file/d/1XFZvhP6K0xyuMw6N-FAlRkUDByzllnf-/view?usp=sharing

I'm currently trying to intercept an event from this button so I can get a reference to it. But I don't really know how.

Here is what I trying to do:

[code]

public class EdTechModule : IModule
    {
        readonly IObjectContainer container;

        public EdTechModule(IObjectContainer container)
        {
            this.container = container;
        }

        public void Initialize()
        {

            var buttonManager = container.Resolve<IInputElement>();
            if (buttonManager != null)
            {
                buttonManager.MouseEnter += ButtonEventAnalizer;
            }

        }


        private void ButtonEventAnalizer(object sender, EventArgs e)
        {

            if (sender.GetType().Name == "DropDownButton")
            {
                DropDownButton dropDownButton = sender as DropDownButton;

                if(agentManager.MyState.State == Status.NotReadyAfterCallWork)
                {
                    dropDownButton.IsEnabled = false;
                }
            }
           
        }
       
    }

[/code]

There is more coding involved but I'm trying to focus only in the event interception problem here.

Does anybody knows how to solve this?

Thanks.
« Last Edit: August 09, 2019, 04:03:00 PM by vinicius.gaspar »