Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellabyte/1524422 to your computer and use it in GitHub Desktop.
Save kellabyte/1524422 to your computer and use it in GitHub Desktop.
public class ApplicationHost
{
private static volatile ApplicationHost instance;
private static object syncRoot = new Object();
private ApplicationHost()
{
Execute.InitializeWithDispatcher();
// Initialize the Funq container.
this.Container = new Container();
}
public static ApplicationHost Current
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
instance = new ApplicationHost();
}
}
return instance;
}
}
public Container Container { get; private set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment