Property Persistance in class
Hello Everyone
I am trying to have a persistent property in a multiuse, persistable class. Here is the code:
VB Code:
Option Explicit
Private dbPath As String
Public Property Let DatabasePath(path As String)
dbPath = path
PropertyChanged "DatabasePath"
End Property
Public Property Get DatabasePath() As String
DatabasePath = dbPath
End Property
Private Sub Class_ReadProperties(PropBag As PropertyBag)
dbPath = PropBag.ReadProperty("DatabasePath")
End Sub
Private Sub Class_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "DatabasePath", dbPath
End Sub
The problem is eventhough I invoke PropertyChanged method, none of the ReadProperties or WriteProperties methods are called (although I know the class goes out of scope and is re-instantiated). Any ideas?