' Collection of code snippets by Arne Vajhøj 
' (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
Imports System

Namespace Singleton
	Public Class LazySingleton
		Private Shared ReadOnly lazy_instance As New Lazy(Of LazySingleton)(Function() New LazySingleton())
		Private someState As Integer
		Private Sub New()
			someState = 123
		End Sub
		Public Shared ReadOnly Property Instance() As LazySingleton
			Get
				Return lazy_instance.Value
			End Get
		End Property
		Public Sub SomeMethod()
			Console.WriteLine(someState)
		End Sub
	End Class
End Namespace
