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

Offline vinicius.gaspar

  • Newbie
  • *
  • Posts: 13
  • Karma: 0
WDE Customization | Disable Agent State Menu
« on: August 10, 2019, 12:21:37 AM »
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: [Select]

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;
                }
            }
           
        }
         
    }


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 10, 2019, 01:03:00 AM by vinicius.gaspar »