Lazy<T> Constructor

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Include Protected Members
Include Inherited Members

Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members

Initializes a new instance of the Lazy<T> class.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public method Lazy<T>() Initializes a new instance of the Lazy<T> class. When lazy initialization occurs, the default constructor of the target type is used.
Public method Lazy<T>(Boolean) Initializes a new instance of the Lazy<T> class. When lazy initialization occurs, the default constructor of the target type and the specified initialization mode are used.
Public method Lazy<T>(Func<T>) Initializes a new instance of the Lazy<T> class. When lazy initialization occurs, the specified initialization function is used.
Public method Lazy<T>(LazyThreadSafetyMode) Initializes a new instance of the Lazy<T> class that uses the default constructor of T and the specified thread safety mode.
Public method Lazy<T>(Func<T>, Boolean) Initializes a new instance of the Lazy<T> class. When lazy initialization occurs, the specified initialization function and initialization mode are used.
Public method Lazy<T>(Func<T>, LazyThreadSafetyMode) Initializes a new instance of the Lazy<T> class that uses the specified initialization function and thread safety mode.

Top

See Also

Reference