Lazy<(Of <(T>)>).Value Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the lazily initialized value of the current Lazy<(Of <(T>)>) instance.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

Public ReadOnly Property Value As T
public T Value { get; }

Property Value

Type: T
The lazily initialized value of the current Lazy<(Of <(T>)>) instance.

Exceptions

Exception Condition
MemberAccessException

The Lazy<(Of <(T>)>) instance is initialized to use the default constructor of the type that is being lazily initialized, and permissions to access the constructor are missing.

MissingMemberException

The Lazy<(Of <(T>)>) instance is initialized to use the default constructor of the type that is being lazily initialized, and that type does not have a public, parameterless constructor.

InvalidOperationException

The initialization function tries to access Value on this instance.

Remarks

If the Lazy<(Of <(T>)>)..::.IsValueCreated property is false, accessing the Value property forces initialization.

In addition to the exceptions that are listed, the Value property can throw any unhandled exception that is thrown by the factory method that was passed to the valueFactory parameter of the Lazy<(Of <(T>)>)(Func<(Of <(T>)>)), Lazy<(Of <(T>)>)(Func<(Of <(T>)>), LazyThreadSafetyMode), or Lazy<(Of <(T>)>)(Func<(Of <(T>)>), Boolean) constructor.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0

See Also

Reference

Lazy<(Of <(T>)>) Class

System Namespace