or
Hi,
Environment
- TTF: 2014.3
- Visual Studio 2012
I am finding that I am not seeing the WindowClosed event handler getting called.
I even set things up so that I manually open and close the window; the event handler
does not seem to be fired.
I'm assuming that TTF does not require any special work to be done by the Wpf client
in order to see the event, right?
Hopefully, someone has some ideas and suggestions.
Thanks in advance,
Below is a sample code :
public class TestClass { private bool _winClosed; private void WindowClosedEventHandler(object sender, EventArgs e) { _winClosed = true; } public void CloseWindow() { var win = wpfClient.WaitForWindow("Header of Window", _settings.ExecuteCommandTimeout); win.WindowClosed += WindowClosedEventHandler; // subscribe to event _winClosed = false; win.Window.SetFocus(); while(!_winClosed) // wait for event handler to set _winClosed to true { Logger.Debug("Waiting for win to close"); Pause(500); } win.WindowClosed -= WindowClosedEventHandler; // unsubscribe to event } ...}