DefaultValue Property

ParameterInfo.DefaultValue Property

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

Gets the default value, if the parameter has a default value.

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

public virtual Object DefaultValue { get; }

Property Value

Type: System.Object
The default value of the parameter, or Value if the parameter has no default value.

The default value is used when an actual value is not specified in the method call. A parameter can have a default value that is null. This is distinct from the case where a default value is not defined.

To get the ParameterInfo array, first get the method or the constructor, and then call MethodBase.GetParameters.

Version Notes

Windows Phone

 DefaultValue returns null in Windows Phone.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2016 Microsoft