Is there a way to specify what members of an object to see in Watch Window without expanding the tree with all the properties. For example:
p = new Point(10 ,10) will display on the Value column in Watch : {X = 10 Y = 10}.
For my own classes it always displays : {MyNamespace.MyClass} or {MyNamespace.MyStruct}.
Could I change this in order to display : { MyStringProperty = "" MyIntProperty = 0 ... } ?
See Using DebuggerDisplay Attribute
If you have marked class by an attribute:
[DebuggerDisplay("x = {X} y = {Y}")]
public class MyClass
{
public int X { get; private set; }
public int Y { get; private set; }
}
Output appearing in the Value column of Watch window will be like following:
x = 5 y = 18
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With