You can decorate classes, fields or properties with DebuggerDisplay attribute.
For example, assuming you have a class like this:
[DebuggerDisplay("[{X},{Y},{Width},{Height}], Area ={Width*Height} ")]
public class Rectangle
{
public int X { get; set; }
public int Y { get; set; }
public int Width { get; set; }
public int Height { get; set; }
}
At debug time, you can see the debugger display like this:
You can use { }
as part of the formatted text, and the text could be name of a field, property, or method. As you can see in the above example, you can use expressions between {}
as well.