Hi Chuck,
A Property is of a certain type. Consider this property to hold someone's first name:
Code:
Private _firstName As String = "Chuck"
Public Property FirstName() As String
Get
Return _firstName
End Get
Set(ByVal Value As String)
_firstName = Value
End Set
End Property
Here, the name of the property is FirstName. It's type is a String (or System.String to be exact). As the property's *backing store* the private variable _firstName is used. The underscore gives this variable a different name than the public property DisplayDirection. The type of that private variable is also a string. As a default value, it gets assigned the text "Chuck" (this is not required though).
When the property is asked for its value (when its Getter is accessed) it returns the value stored in _firstName. When the property gets assigned a value (its Setter is accessed) the value is stored in _firstName. In other words, properties don't contain their own state, but use a backing store (such as a private variable, but in later examples you see how to use ViewState for this purpose) to store their data.
The same principle is used for the DisplayDirection property:
Code:
Private _displayDirection As Direction = Direction.Vertical
Public Property DisplayDirection() As Direction
Get
Return _displayDirection
End Get
Set(ByVal value As Direction)
_displayDirection = value
End Set
End Property
Here, the property is called DisplayDirection. Its type is Direction which is the Enum you defined earlier. As the backing store, the private variable _displayDirection is used. This variable gets the Enum value of Direction.Vertical assigned as its default value.
Does this clarify things? If not, feel free to post a follow message asking for clarification.
Cheers,
Imar