Trying to set default values at runtime, the following class is used for my propertygrid:
public class zPosition
{
public int _x;
public int _y;
public zPosition(int x, int y, int dx = 0, int dy = 0)
{
this._x = 10;
this._y = 10;
// set the default values here
}
[DisplayName("X"), DefaultValueAttribute(0)]
public int X
{
get { return _x; }
set { _x = value; }
}
[DisplayName("Y"), DefaultValueAttribute(0)]
public int Y
{
get { return _y; }
set { _y = value; }
}
}
How would I set those default values in the class constructor?
Thanks