DebuggerDisplayAttribute Constructor
Collapse the table of content
Expand the table of content

DebuggerDisplayAttribute Constructor

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

Initializes a new instance of the DebuggerDisplayAttribute class.

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

'Declaration
Public Sub New ( _
	value As String _
)

Parameters

value
Type: System.String
The string to be displayed in the value column for instances of the type. An empty string ("") causes the value column to be hidden.

The value parameter can contain braces ({ and }). The text within a pair of braces is evaluated as the name of a field, property, or method. For example, the following C# code causes "Count = 4" to be displayed when the plus sign (+) is clicked to expand the debugger display for an instance of MyTable.

[c#]

[DebuggerDisplay("Count = {count}")]
class MyTable
{
    public int count = 4;
}

Attributes that are applied to properties referenced in the expression are not processed. For some compilers, a general expression may be allowed that has only implicit access to this reference for the current instance of the target type. The expression is limited; there is no access to aliases, locals, or pointers.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft