I have a FileSystemWatcher that react on the Changed event.
I want to open the file, read its content display it in a textbox and hide the popup that has been create
To execute the extendedNotifyIcon_OnHideWindow
method on the GUI thread use the Dispatcher
as you did to show it.
Thread threadToClosePopup = new Thread(new ThreadStart((Action)delegate() {
Thread.Sleep(1000);
txtLog.Dispatcher.Invoke(
DispatcherPriority.Normal,
(Action)() => extendedNotifyIcon_OnHideWindow());
}));