Public Property Line() As String
Get
Return DirectCast(GetValue("Line"), String)
End Get
Set(value As String)
SetValue("Line", value)
End Set
End Property
Public Property Color() As String
Get
Return DirectCast(GetValue("Color"), String)
End Get
Set(value As String)
SetValue("Color", value)
End Set
End Property
Public Property Name() As String
Get
Return DirectCast(GetValue("Name"), String)
End Get
Set(value As String)
SetValue("Name", value)
End Set
End Property
Public Property Price() As Double
Get
Return CDbl(GetValue("Price"))
End Get
Set(value As Double)
SetValue("Price", value)
End Set
End Property
Public Property Weight() As Double
Get
Return CDbl(GetValue("Weight"))
End Get
Set(value As Double)
SetValue("Weight", value)
End Set
End Property
Public Property Cost() As Double
Get
Return CDbl(GetValue("Cost"))
End Get
Set(value As Double)
SetValue("Cost", value)
End Set
End Property
Public Property Volume() As Double
Get
Return CDbl(GetValue("Volume"))
End Get
Set(value As Double)
SetValue("Volume", value)
End Set
End Property
Public Property Discontinued() As Boolean
Get
Return CBool(GetValue("Discontinued"))
End Get
Set(value As Boolean)
SetValue("Discontinued", value)
End Set
End Property
Public Property Rating() As Integer
Get
Return CInt(GetValue("Rating"))
End Get
Set(value As Integer)
SetValue("Rating", value)
End Set
End Property
' get/set values
Private values As New Dictionary(Of String, Object)()
Private Function GetValue(p As String) As Object
Dim value As Object
values.TryGetValue(p, value)
Return value
End Function
Private Sub SetValue(p As String, value As Object)
If Not Object.Equals(value, GetValue(p)) Then
values(p) = value
OnPropertyChanged(p)
End If
End Sub
Public Shared Function GetLines() As String()
Return lines
End Function