I have a textbox usercontrol with a property of type validation
which derives from one of my classes. In the designer the property gets displayed as a collection, however the items that I add to that collection doesn't get saved. Here is the complete code.
Public Class validationList
Private _key As validationTypes
Private _value As String
Sub New()
_key = 0
_value = ""
End Sub
Public Sub New(ByVal k As validationTypes, ByVal v As String)
_key = k
_value = v
End Sub
Public Enum validationTypes
man = 0
num = 1
End Enum
Public Property Key As validationTypes
Get
Return _key
End Get
Set(ByVal value As validationTypes)
_key = value
End Set
End Property
Public Property value As String
Get
Return _value
End Get
Set(ByVal value As String)
_value = value
End Set
End Property
End Class
And this is the property that gets exposed via the usercontrol
Private _validation As List(Of validationList)
Public Property validation As List(Of validationList)
Get
Return _validation
End Get
Set(ByVal value As List(Of validationList))
_validation = value
End Set
End Property