I've developed a simple custom message window using NTWindow.
What I would like to do is to close it while one is still open, how can I achieve that?
The code calling the window looks like this:
if (ShowPullbackPopUp)
Globals.RandomDispatcher.InvokeAsync(new Action(() =>
{
PopUp = new PopUpWindow()
{
Caption = "SuperTrenderMA Pullback Alert",
TargetIndicator = this,
message = message
};
PopUp.Show(); // open the window
PopUp.Activate(); // bring to the top
}));
Edit:
I've managed to figure out some solution:
if (ShowPullbackPopUp)
Globals.RandomDispatcher.InvokeAsync(new Action(() =>
{
if (PopUp != null)
PopUp.Close();
PopUp = new PopUpWindow()
{
Caption = "SuperTrenderMA Pullback Alert",
TargetIndicator = this,
message = message
};
PopUp.Show(); // open the window
PopUp.Activate(); // bring to the top
}));
