F
ffa
I have a number of classes that declare a public Event called RefreshData:
Public Class Client
Implements INotifyPropertyChanged
Implements IDisposable
Implements IDataErrorInfo
Public Event PropertyChanged(ByVal sender As Object, ByVal e As
System.ComponentModel.PropertyChangedEventArgs) Implements
System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Public Event ErrorMsg(ByVal ErrMsg As String)
Public Event RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Private WithEvents _ValidationRules As New Validation.brokenRules(Me)
<snip>
The event is reaised whenever the class does a data fetch:
<snip>
_Updated = CDate(IfNull(.Item("Updated"), Date.MinValue))
_Operator_ID = CInt(IfNull(.Item("Operator_ID"), 0))
End With
_Memo = New ClientMemo(_DatabaseName, _ID)
HasData = True
IsDirty = False
CanDelete = Can_Delete("Client", _ID, _DatabaseName)
RaiseEvent RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
In any form where this is used it is declared as follows:
Private WithEvents oClient As TRM8.WFL.Client
and is handled as follows:
Private Sub oClient_Refresh() Handles oClient.RefreshData
With oClient
mnuEditClient.Enabled = .HasData
End With
End Sub
The problem I am experiencing is that the "oClient_Refresh" method is no
longer being called (it was working). Added to this several other classes
with the same event are displaying the same behaviour. I have triple checked
my code and all appears well.
Has anyone seen this behaviour before? ....or can offer any suggestions.
Thank you
Public Class Client
Implements INotifyPropertyChanged
Implements IDisposable
Implements IDataErrorInfo
Public Event PropertyChanged(ByVal sender As Object, ByVal e As
System.ComponentModel.PropertyChangedEventArgs) Implements
System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Public Event ErrorMsg(ByVal ErrMsg As String)
Public Event RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Private WithEvents _ValidationRules As New Validation.brokenRules(Me)
<snip>
The event is reaised whenever the class does a data fetch:
<snip>
_Updated = CDate(IfNull(.Item("Updated"), Date.MinValue))
_Operator_ID = CInt(IfNull(.Item("Operator_ID"), 0))
End With
_Memo = New ClientMemo(_DatabaseName, _ID)
HasData = True
IsDirty = False
CanDelete = Can_Delete("Client", _ID, _DatabaseName)
RaiseEvent RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
In any form where this is used it is declared as follows:
Private WithEvents oClient As TRM8.WFL.Client
and is handled as follows:
Private Sub oClient_Refresh() Handles oClient.RefreshData
With oClient
mnuEditClient.Enabled = .HasData
End With
End Sub
The problem I am experiencing is that the "oClient_Refresh" method is no
longer being called (it was working). Added to this several other classes
with the same event are displaying the same behaviour. I have triple checked
my code and all appears well.
Has anyone seen this behaviour before? ....or can offer any suggestions.
Thank you