T
tshad
I was watching a video that used a code snippet to create a property and
when you type "prop" tab tab, it would create the private variable as well
as the property definitions with the private variable in it. When you
changed the private variable it would also change the variables in the
Property definition.
But when I do it, I only get the property definition but no variables in it:
public int MyProperty { get; set; }
Why is that?
Where is the rest of the code?
In the example it would do:
private int myVar;
public int MyProperty
{
get { return myVar; }
set {myVar = value; }
}
Thanks,
Tom
when you type "prop" tab tab, it would create the private variable as well
as the property definitions with the private variable in it. When you
changed the private variable it would also change the variables in the
Property definition.
But when I do it, I only get the property definition but no variables in it:
public int MyProperty { get; set; }
Why is that?
Where is the rest of the code?
In the example it would do:
private int myVar;
public int MyProperty
{
get { return myVar; }
set {myVar = value; }
}
Thanks,
Tom