Page 1 of 1

Global Pop-up Screen

Posted: Tue Sep 15, 2015 4:55 am
by ricardo_jpm
Hi, I've created a popup screen to show an alert to the user.
Now I want to show this popup every time that a tag changes from 0 to 1, independently on which screen is activated.
I know this is possible because I've seen it on an application.
My question is how to make this?

Re: Global Pop-up Screen

Posted: Wed Sep 16, 2015 9:14 am
by Greg M
Add an event handler to the tag and use scripting in the event handler to show the pop-up screen:

IScreen screen = getScreen("requiredPageName");
if(screen != null)
{
screen.Show();
}


public static IScreen getScreen(string pageName)
{
try
{
Type type = System.Type.GetType("Neo.ApplicationFramework.Generated." + pageName);
if (type != null)
{
return Globals.GetObject<IScreen>(type, pageName);
}
}
catch { }

return null;
}

I think this should work.