Problems creating my own Window in a binary plug-in

Coordinator
Oct 16, 2015 at 5:42 PM
I created my own Window rather than using the (optional) window provided by the Execute method in a binary plug-in. I show the window as a dialog box:
namespace VMS.TPS
{
    public class Script
    {
        public void Execute(ScriptContext scriptContext)
        {
            MainWindow window = new MainWindow();
            window.ShowDialog();
        }
    }
}
While running this script, if I click on another program and then come back to my script window, the keyboard doesn't work. I'm unable to type anything in TextBoxes. Also, even though the window appears to have been activated (its window bar turns blue), its button is not highlighted in the Taskbar and the window remains behind the program I had switched to.

I've noticed that everything is normal if I use the window object provided by the Execute method. Also, this problem appears to happen in a Citrx environment only. It doesn't happen if run my script locally.

Has anyone encountered this problem?
Coordinator
Oct 28, 2015 at 2:52 PM
I make my own windows on Citrix and don't have this problem. I always use the incoming window as well. Is there a reason that you can't use the ESAPI provided window (so I can better understand how to think about this).
Coordinator
Oct 28, 2015 at 4:27 PM
I may have to start using the ESAPI provided window, but I haven't before because I like to have control over the window that my script is hosted on. For example, I can set my window's title, starting location, and window state using XAML instead of setting them through code. It makes more sense to me to have a main window XAML file than a main user control XAML file.